/* ===== Design Tokens ===== */
:root {
  --color-primary: #1a1a1a;
  --color-secondary: #8a8a8a;
  --color-border: #f0f0f0;
  --color-bg: #ffffff;
  --color-tag-bg: #f7f7f7;
  --color-available: #34C759;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Newsreader', 'Times New Roman', Georgia, serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
  --shadow-avatar: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.08);
  --shadow-cta: 0 1px 3px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-social: 0 1px 4px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --gradient-cta: linear-gradient(135deg, #1a1a1a 0%, #333333 50%, #1a1a1a 100%);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

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

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

/* ===== Layout ===== */
.portfolio {
  width: 100%;
  max-width: 480px;
  margin: 60px 20px 100px;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

/* ===== Header Section ===== */
.header {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 40px;
}

/* Profile Row */
.profile-row {
  display: flex;
  gap: 22px;
  align-items: center;
}

.avatar-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-avatar);
  flex-shrink: 0;
  user-select: none;
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-info .name {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-primary);
  line-height: 1.4;
}

.profile-info .role {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--color-secondary);
  line-height: 1.4;
}

/* About Section */
.about {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-secondary);
  letter-spacing: 0.02em;
  font-weight: 500;
}

.about-text {
  font-size: 14px;
  color: var(--color-primary);
  line-height: 1.65;
  text-wrap: pretty;
}

.about-text a {
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

.about-text a:hover {
  opacity: 0.7;
}

/* Social Icons */
.social-icons {
  display: flex;
  align-items: center;
  margin-left: 6px;
}

.social-icon {
  width: 44px;
  height: 44px;
  border: 2.5px solid #ffffff;
  background: var(--gradient-cta);
  border-radius: 12px;
  overflow: hidden;
  margin-left: -6px;
  box-shadow: var(--shadow-social);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  opacity: 0;
  animation: socialPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.social-icon:first-child {
  margin-left: 0;
}

.social-icon:nth-child(1) { animation-delay: 0.1s; }
.social-icon:nth-child(2) { animation-delay: 0.2s; }
.social-icon:nth-child(3) { animation-delay: 0.3s; }
.social-icon:nth-child(4) { animation-delay: 0.4s; }

@keyframes socialPop {
  0% {
    opacity: 0;
    transform: scale(0.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.social-icon:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.1);
}

.social-icon a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.social-icon svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
  transition: filter 0.3s ease;
}

.social-icon:hover svg {
  filter: drop-shadow(0px 0px 4px rgba(250, 250, 250, 1));
}

/* CTA Row */
.cta-row {
  display: flex;
  gap: 22px;
  align-items: center;
}

.contact-btn {
  font-size: 12px;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 9999px;
  background: var(--gradient-cta);
  border: none;
  outline: 1px solid rgba(255, 255, 255, 0.2);
  outline-offset: -1px;
  box-shadow: var(--shadow-cta);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  user-select: none;
  text-decoration: none;
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.contact-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15), 0 6px 20px rgba(0,0,0,0.1);
}

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

.status-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-dot {
  position: relative;
  width: 18px;
  height: 18px;
}

.status-dot-inner {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-available);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.status-dot-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: rgba(52, 199, 89, 0.2);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.status-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--color-secondary);
}

/* ===== Divider ===== */
.divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
}

/* ===== Works Section ===== */
.works-section {
  display: flex;
  flex-direction: column;
}

.works-section .section-label {
  margin-bottom: 16px;
}

.works-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.other-works-grid {
  gap: 60px;
}

/* ===== Project Card ===== */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-images {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-image-wrapper {
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  position: relative;
  background-color: #f5f5f5;
}

.project-image-wrapper.ratio-3-2 {
  aspect-ratio: 3 / 2;
}

.project-image-wrapper.ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.project-image-wrapper.ratio-129-146 {
  aspect-ratio: 129 / 146;
  border: 1px solid var(--color-border);
}

.project-image-wrapper.ratio-4-3 {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--color-border);
}

.project-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-image-wrapper:hover img {
  transform: scale(1.02);
}

.project-title {
  font-size: 14px;
  color: var(--color-primary);
  font-weight: 400;
}

/* Project Meta Row */
.project-meta {
  display: flex;
  gap: 32px;
  align-items: center;
}

.project-meta .project-title {
  flex: 1;
}

.project-tags {
  display: flex;
  gap: 8px;
  margin-left: 12px;
  flex-shrink: 0;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-secondary);
  background-color: var(--color-tag-bg);
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 500;
}

/* ===== Image Lightbox ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-overlay.active img {
  transform: scale(1);
}

/* ===== Scroll Animation ===== */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (min-width: 560px) {
  .portfolio {
    margin-left: 0;
    margin-right: 0;
  }

  .contact-btn {
    outline-offset: -1.5px;
    outline-width: 1.5px;
  }
}

@media (max-width: 380px) {
  .portfolio {
    margin-top: 40px;
    margin-bottom: 60px;
    gap: 40px;
  }

  .cta-row {
    gap: 16px;
  }

  .project-meta {
    flex-wrap: wrap;
    gap: 12px;
  }

  .project-tags {
    margin-left: 0;
  }
}

/* ===== Placeholder Image Gradients (for projects without generated images) ===== */
.placeholder-gradient {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.placeholder-gradient.otivate {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.placeholder-gradient.billa {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.placeholder-gradient.pixels {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.placeholder-gradient.dfetech {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.placeholder-gradient.c2ro {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.placeholder-gradient.icelerate {
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.placeholder-gradient.doxel {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  color: rgba(0,0,0,0.4);
}

.placeholder-gradient.eezycloud {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.placeholder-gradient.iot-platform {
  background: linear-gradient(135deg, #0c3483 0%, #a2b6df 50%, #6b8cce 100%);
}
