/* ==========================================================================
   syuxx.shop Portfolio - Core Design System CSS
   ========================================================================== */

/* Font Imports */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@300;400;500;600;700&family=Syne:wght@500;700;800&family=Gaegu:wght@400;700&display=swap');

/* Pretendard (CDN) for Korean typography */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/pretendard.css");

:root {
  /* Colors */
  --bg-primary: #ffffed; /* Warm Ivory background */
  --bg-base: #ffffff;
  --color-olive: #717e36; /* Signature Olive Green */
  --color-black: #000000;
  --color-muted: #a4a4a4;
  --color-light-gray: #e5e5e5;
  --color-border: rgba(80, 80, 80, 0.2);
  --color-border-active: rgba(80, 80, 80, 0.75);

  /* Fonts */
  --font-sans: 'Pretendard', 'Inter', -apple-system, sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-display: 'Syne', sans-serif;
  --font-playful: 'Gaegu', cursive;

  /* Spacing & Layout */
  --header-height: 100px;
  --header-height-mobile: 80px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px; /* Base font size */
}

body {
  background-color: var(--bg-primary);
  color: var(--color-olive);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-top: var(--header-height); /* Offset for pinned header */
}

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

a:hover {
  opacity: 1;
}

hr {
  background: var(--color-border);
  border: 0;
  height: 1px;
  margin: 3rem 0;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.intro-section {
  padding-top: 5rem;
  padding-bottom: 3rem;
}

/* Typography Utility Classes */
h1 {
  font-family: var(--font-sans);
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

h1.display-title {
  font-family: var(--font-display);
  font-size: 7rem;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--color-black);
}

h2 {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

h3.serif-title {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 400;
  color: var(--color-black);
}

p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.sub-text {
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* ==========================================================================
   Navigation (Pinned Header)
   ========================================================================== */
.pinned-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  transition: border-color 0.3s ease;
}

.pinned-header.scrolled {
  border-bottom-color: var(--color-border-active);
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  width: 100%;
  align-items: center;
  gap: 1rem;
}

/* Logo Area */
.nav-logo-area {
  grid-column: span 4;
  display: flex;
  align-items: center;
}

.logo-container {
  display: block;
  position: relative;
  width: 80px;
  height: 80px;
}

.logo-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.logo-container .logo-animated {
  opacity: 0;
}

.logo-container:hover .logo-static {
  opacity: 0;
}

.logo-container:hover .logo-animated {
  opacity: 1;
}

/* Menu Links */
.nav-links-area {
  grid-column: span 5;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.nav-menu li a {
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0.35;
  transition: opacity 0.2s ease;
}

.nav-menu li a.active,
.nav-menu li a:hover {
  opacity: 1;
}

/* Right Inquiry Area */
.nav-inquiry-area {
  grid-column: span 3;
  text-align: right;
}

.nav-inquiry-area h3 {
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-inquiry-area a {
  font-weight: 600;
  opacity: 0.8;
}

.nav-inquiry-area a:hover {
  opacity: 1;
}

/* ==========================================================================
   Asymmetric Grid Layout Components
   ========================================================================== */
.asymmetric-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 5rem;
  row-gap: 4rem;
  margin-top: 3rem;
}

/* Grid Cell Styles */
.grid-cell {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Span utilities */
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: span 12; }

/* Media Box Wireframe (Placeholder for projects) */
.media-box-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background-color: rgba(113, 126, 54, 0.05); /* Tinted background */
  border: 1px dashed var(--color-olive);
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-style 0.3s ease, background-color 0.3s ease;
}

/* Media Box Aspect ratio helpers */
.ratio-square { aspect-ratio: 1/1; }
.ratio-portrait { aspect-ratio: 3/4; }
.ratio-landscape { aspect-ratio: 16/9; }

/* Media Box Hover Effect (Inset Shadow) */
.media-box-placeholder:hover {
  box-shadow: inset 0 0 25px rgba(113, 126, 54, 0.2);
  background-color: rgba(113, 126, 54, 0.08);
  border-style: solid;
  cursor: pointer;
}

.media-box-placeholder::after {
  content: "+";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  opacity: 0.15;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.media-box-placeholder:hover::after {
  opacity: 0.8;
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Captions & Meta info */
.cell-caption {
  margin-top: 1rem;
  padding-right: 0.5rem;
  transition: opacity 0.2s ease;
}

.cell-caption:hover {
  opacity: 0.3;
}

.cell-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--color-black);
}

.cell-desc {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--color-olive);
}

/* Upcoming Projects (Blur Effect) */
.upcoming-project {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.upcoming-label {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--color-olive);
  color: var(--bg-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 10;
}

/* ==========================================================================
   Floating Widgets (Live Counter Widget)
   ========================================================================== */
.live-pill-widget {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 9999px;
  background: var(--color-black);
  color: var(--bg-base);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, opacity 0.25s ease;
  user-select: none;
  cursor: default;
}

.live-dot {
  color: #10b981; /* Glowing green */
  font-size: 0.9rem;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* ==========================================================================
   Page Specific Layouts
   ========================================================================== */

/* About Me: Tag Cloud / Keywords */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.tag-badge {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-olive);
  border: 1px solid var(--color-olive);
  border-radius: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: transparent;
  transition: all 0.2s ease;
}

.tag-badge:hover {
  background: var(--color-olive);
  color: var(--bg-primary);
  cursor: default;
}

/* Portfolio: Filter Navigation */
.portfolio-filters {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
  list-style: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.filter-btn {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  background: none;
  border: none;
  color: var(--color-olive);
  opacity: 0.4;
  cursor: pointer;
  padding-bottom: 0.5rem;
  position: relative;
  transition: opacity 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  opacity: 1;
}

.filter-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-olive);
}

/* Resume: Grid Structure */
.resume-section {
  margin-bottom: 4rem;
}

.resume-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
}

.resume-header {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
}

.resume-timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.resume-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
}

.resume-date {
  font-weight: 600;
  opacity: 0.7;
}

.resume-details h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: 0.25rem;
}

.resume-details h4 {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

/* Contact: Huge typography layout */
.contact-layout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - var(--header-height) - 150px);
}

.contact-email-link {
  font-family: var(--font-display);
  font-size: 5.5rem;
  font-weight: 800;
  line-height: 1.1;
  word-break: break-all;
  letter-spacing: -0.03em;
  color: var(--color-olive);
  display: inline-block;
  margin-top: 2rem;
  margin-bottom: 3rem;
  position: relative;
}

.contact-email-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--color-olive);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.contact-email-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.sns-links {
  display: flex;
  gap: 3rem;
  margin-top: 2rem;
  list-style: none;
}

.sns-links a {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 600;
  opacity: 0.5;
}

.sns-links a:hover {
  opacity: 1;
}

/* ==========================================================================
   Responsive Styles (Mobile First)
   ========================================================================== */
@media (max-width: 1024px) {
  h1.display-title {
    font-size: 5rem;
  }
  .contact-email-link {
    font-size: 4rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 80px;
  }
  
  body {
    padding-top: var(--header-height-mobile);
  }
  
  .pinned-header {
    height: var(--header-height-mobile);
    padding: 0 1rem;
  }
  
  .nav-grid {
    display: flex;
    justify-content: space-between;
  }
  
  .logo-container {
    width: 60px;
    height: 60px;
  }
  
  .nav-links-area {
    display: flex;
    justify-content: flex-end;
  }
  
  .nav-inquiry-area {
    display: none; /* Hide inquiry mail on mobile headers */
  }

  .container {
    padding: 2rem 1rem;
  }
  
  .intro-section {
    padding-top: 2rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  h1.display-title {
    font-size: 3.5rem;
  }

  .asymmetric-grid {
    grid-template-columns: 1fr; /* Force 1 column on mobile */
    column-gap: 0;
    row-gap: 3rem;
  }
  
  .grid-cell {
    grid-column: span 12 !important; /* Force items to span full width */
  }
  
  .resume-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .resume-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  
  .contact-email-link {
    font-size: 2.2rem;
    margin-bottom: 2rem;
  }
  
  .sns-links {
    flex-direction: column;
    gap: 1rem;
  }
  
  .live-pill-widget {
    left: 10px;
    bottom: 10px;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   Project Details Modal Styles
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background-color: var(--bg-primary);
  border: 1px solid var(--color-olive);
  border-radius: 8px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 12px 36px rgba(113, 126, 54, 0.15);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  padding: 3rem 2rem;
}

.modal-overlay.open .modal-container {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  font-weight: 300;
  color: var(--color-olive);
  cursor: pointer;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.modal-close-btn:hover {
  opacity: 0.6;
}

.modal-content-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
}

.modal-image-area img {
  width: 100%;
  height: auto;
  border-radius: 5px;
  border: 1px solid var(--color-border);
  display: block;
}

.modal-info-area {
  display: flex;
  flex-direction: column;
}

.modal-project-title {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.modal-project-category {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-olive);
  border: 1px solid var(--color-olive);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  align-self: flex-start;
  margin-bottom: 1.5rem;
}

.modal-project-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-olive);
  margin-bottom: 2rem;
}

.modal-btn {
  background-color: var(--color-olive);
  color: var(--bg-primary);
  border: 1px solid var(--color-olive);
  border-radius: 5px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.2s ease;
  text-align: center;
}

.modal-btn:hover {
  background-color: transparent;
  color: var(--color-olive);
}

/* Modal Responsive */
@media (max-width: 768px) {
  .modal-content-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .modal-container {
    padding: 2.5rem 1.5rem;
    max-height: 90vh;
  }
  .modal-project-title {
    font-size: 1.5rem;
  }
}
