/* style.css - somin.site Design System */

/* 1. Reset & Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* CSS Variables */
:root {
  --color-bg-primary: #e8f4ff;
  --color-bg-secondary: #e0effc;
  --color-bg-dark: #080808;
  --color-text-primary: #080808;
  --color-text-secondary: #5f6360;
  --color-text-light: #ffffff;
  --color-accent: #116dff;
  
  --space-xs: 0.5rem;   /* 8px */
  --space-sm: 1rem;     /* 16px */
  --space-md: 2rem;     /* 32px */
  --space-lg: 4rem;     /* 64px */
  --space-xl: 8rem;     /* 128px */
}

/* Utility Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* 2. Header (Navigation) */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.5rem 0;
  background-color: var(--color-bg-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.site-header .logo-link {
  text-decoration: none;
  color: var(--color-text-primary);
}

.site-header .logo {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.site-header .nav-links {
  display: flex;
  align-items: center;
}

.site-header .nav-links a {
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-left: 2.5rem;
  font-weight: 700;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

.site-header .nav-links a:hover,
.site-header .nav-links a.active {
  color: var(--color-text-primary);
}

/* Underline effect for active link */
.site-header .nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent);
}

/* 3. Hero Section (Opening Fold) */
.hero-section {
  padding: var(--space-xl) 0 var(--space-lg) 0;
  background-color: var(--color-bg-primary);
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
  max-width: 1000px;
  color: var(--color-text-primary);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  font-weight: 400;
}

/* 4. Layout Frameworks (Skeletons/Placeholders) */
.layout-placeholder {
  border: 1px dashed rgba(0, 0, 0, 0.15);
  background-color: var(--color-bg-secondary);
  border-radius: 6px;
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.layout-placeholder h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}

/* Grid Layout (e.g. for projects/archive) */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg) var(--space-md);
  margin-bottom: var(--space-xl);
}

.project-card.full-width {
  grid-column: span 4;
}

.project-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}


.image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background-color: var(--color-bg-secondary);
  aspect-ratio: 3 / 4;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-card:hover {
  transform: translateY(-8px);
}

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

.project-info {
  margin-top: 1.5rem;
}

.meta-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
}

.project-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.project-desc {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  max-width: 90%;
}

/* Split Layout (e.g. for about/capabilities) */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.split-layout h2 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.layout-right .group-item {
  margin-bottom: var(--space-md);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: var(--space-md);
}

.layout-right .group-item:last-child {
  border-bottom: none;
}

.layout-right .group-item h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.layout-right .group-item p {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* 5. Contact Section */
.contact-section {
  padding: var(--space-xl) 0;
  background-color: var(--color-bg-primary);
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.contact-section h2 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
}

.email-cta {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity 0.3s ease;
  display: inline-block;
  margin-bottom: var(--space-md);
}

.email-cta:hover {
  opacity: 0.8;
}

.footer-links {
  margin-top: var(--space-md);
}

.footer-links a {
  text-decoration: none;
  color: var(--color-text-secondary);
  font-weight: 700;
  margin: 0 1.5rem;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--color-text-primary);
}

/* 6. Modal Styles */
.project-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(8, 8, 8, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.project-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--color-bg-primary);
  border-radius: 0;
  width: 90%;
  max-width: 950px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.project-modal.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--color-text-primary);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.modal-close:hover {
  transform: scale(1.05);
  background-color: #ffffff;
}

.modal-prev,
.modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 2rem;
  z-index: 1010;
  transition: color 0.2s ease, transform 0.2s ease;
  user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-prev:hover,
.modal-next:hover {
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}

.modal-prev {
  left: 1.5rem;
}

.modal-next {
  right: 1.5rem;
}

@media (max-width: 768px) {
  .modal-prev,
  .modal-next {
    display: none !important;
  }
}

.modal-media {
  background-color: var(--color-bg-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  max-height: 90vh;
}

.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-body {
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  max-height: 90vh;
}

.modal-meta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.modal-desc {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.modal-video-link,
.modal-pdf-link {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  background-color: var(--color-text-primary);
  color: var(--color-text-light);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 4px;
  align-self: flex-start;
  transition: background-color 0.3s ease;
  margin-top: 1rem;
}

.modal-video-link:hover,
.modal-pdf-link:hover {
  background-color: var(--color-accent);
}

/* 7. Responsive adjustments */
@media (max-width: 1024px) {
  .grid-layout {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-card.full-width {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 0;
  }
  .site-header .nav-links {
    margin-top: 1.5rem;
    flex-wrap: wrap;
  }
  .site-header .nav-links a {
    margin-left: 0;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
  }
  .hero-title {
    font-size: 3rem;
  }
  .grid-layout {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .project-card.full-width {
    grid-column: span 1;
  }
  .split-layout {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .contact-section h2 {
    font-size: 2.25rem;
  }
  .email-cta {
    font-size: 1.75rem;
  }
  
  /* Modal responsive */
  .modal-content {
    grid-template-columns: 1fr;
    max-height: 95vh;
  }
  .modal-media {
    max-height: 40vh;
  }
  .modal-media img {
    aspect-ratio: 16/10;
  }
  .modal-body {
    padding: 2rem 1.5rem;
    max-height: 55vh;
  }
}

/* 8. Experience Page (Timeline & Journal Grid) */
.experience-sections {
  padding: var(--space-md) 0 var(--space-xl) 0;
}

.experience-section-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  border-bottom: 2px solid var(--color-text-primary);
  padding-bottom: var(--space-xs);
  display: inline-block;
}

/* Timeline Layout */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto var(--space-xl) auto;
  padding: var(--space-md) 0;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background-color: rgba(0, 0, 0, 0.1);
  top: 0;
  bottom: 0;
  left: 32px;
  margin-left: -1px;
}

.timeline-item {
  padding: 0 0 var(--space-lg) 64px;
  position: relative;
}

.timeline-badge {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--color-bg-primary);
  border: 3px solid var(--color-accent);
  position: absolute;
  left: 32px;
  top: 6px;
  margin-left: -7px;
  z-index: 10;
  transition: transform 0.3s ease;
}

.timeline-item:hover .timeline-badge {
  transform: scale(1.3);
  background-color: var(--color-accent);
}

.timeline-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.timeline-desc {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* Journal Grid Layout */
.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.journal-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-secondary);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.journal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.journal-media {
  aspect-ratio: 4 / 3;
  background-color: #ededed;
  overflow: hidden;
  position: relative;
}

.journal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.journal-media::after {
  content: 'Inspiration Spot';
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.3;
}

.journal-body {
  padding: 1.5rem;
}

.journal-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  display: block;
}

.journal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
}

.journal-desc {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .timeline::after {
    left: 16px;
  }
  .timeline-item {
    padding-left: 40px;
  }
  .timeline-badge {
    left: 16px;
  }
  .journal-grid {
    grid-template-columns: 1fr;
  }
}

/* 9. Home Featured Photo (Responsive) */
.home-featured-photo {
  width: 100vw;
  height: 90vh;
  overflow: hidden;
  position: relative;
  margin-bottom: var(--space-xl);
  background-color: var(--color-bg-primary); /* Restored to primary sky blue */
}

.home-featured-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.05); /* Soft scale zoom initial */
  transition: opacity 1.5s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.home-featured-photo img.loaded {
  opacity: 1;
  transform: none; /* Completely reset transform to disable GPU tiling and subpixel seams when loaded */
}

@media (max-width: 768px) {
  .home-featured-photo {
    height: 60vh;
    margin-bottom: var(--space-lg);
  }
}

/* 10. Home Footer overrides (smaller text) */
.contact-section.home-footer {
  padding: 1.5rem 0;
}
.contact-section.home-footer h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}
.contact-section.home-footer .email-cta {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.contact-section.home-footer .footer-links {
  margin-top: 0.25rem;
}
.contact-section.home-footer .footer-links a {
  font-size: 0.8rem;
}

/* 11. Horizontal Wheel Scroll (Photo & Project Pages) */
.scroll-container {
  width: 100%;
  padding: 6rem 0;
  background-color: var(--color-bg-primary);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.scroll-track-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
  display: flex;
  align-items: center;
}

.scroll-track-wrapper::-webkit-scrollbar {
  display: none; /* Webkit/Chrome/Safari */
}

.horizontal-scroll-content {
  display: flex;
  gap: 4rem;
  padding: 0 10vw;
  will-change: scroll-position;
}

.horizontal-scroll-content .photo-item,
.horizontal-scroll-content .project-card {
  flex: 0 0 auto;
  height: 60vh;
  width: 45vh; /* portrait proportions */
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.horizontal-scroll-content .photo-item {
  padding: 0; /* photos don't need inner card padding */
  border-radius: 0;
  border: none;
  width: 45vh; /* same width */
}

.horizontal-scroll-content .photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.horizontal-scroll-content .project-card {
  height: auto;
}

.horizontal-scroll-content .project-card .image-wrapper {
  width: 100%;
  height: 60vh; /* Match the height of the photo items */
  flex: 0 0 auto;
  border-radius: 0;
}

/* Adjust image focus points inside portrait crop */
.horizontal-scroll-content .project-card:nth-child(1) .image-wrapper img {
  object-position: center 15%;
}
.horizontal-scroll-content .project-card:nth-child(2) .image-wrapper img {
  object-position: center 10%;
}
.horizontal-scroll-content .project-card:nth-child(3) .image-wrapper img {
  object-position: center;
}
.horizontal-scroll-content .project-card:nth-child(4) .image-wrapper img {
  object-position: center;
}

.horizontal-scroll-content .project-card .project-info {
  margin-top: 1rem;
  flex-shrink: 0;
}

.horizontal-scroll-content .project-card .project-title {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.horizontal-scroll-content .project-card .project-desc {
  font-size: 0.9rem;
  max-width: 100%;
  white-space: normal; /* wrap text normally */
  display: -webkit-box;
  -webkit-line-clamp: 2; /* clamp description to 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hover effects */
.horizontal-scroll-content .photo-item:hover img {
  transform: scale(1.05);
}

.horizontal-scroll-content .project-card:hover {
  transform: translateY(-8px);
}

/* Fallback for touch screens / mobile */
@media (max-width: 768px) {
  .scroll-container {
    padding: 2rem 0;
  }
  .horizontal-scroll-content {
    padding: 0 1.5rem;
    gap: 1.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .horizontal-scroll-content .photo-item {
    height: 55vh;
    width: 40vh;
    scroll-snap-align: start;
  }
  .horizontal-scroll-content .project-card {
    height: auto;
    width: 40vh;
    scroll-snap-align: start;
  }
  .horizontal-scroll-content .project-card .image-wrapper {
    height: 55vh;
  }
}



