/* ============================================================
   MinJee Hahm — Portfolio Stylesheet
   Redesign: Editorial + Credential-forward
   Inspired by amylalai.com + michellegore.com
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* Colors — Light Theme */
  --color-bg:           #f7f7f8;
  --color-text:         #1a1a2e;
  --color-text-light:   #4b5563;
  --color-muted:        #9ca3af;
  --color-accent:       #7c3aed;
  --color-accent-hover: #6d28d9;
  --color-accent-soft:  rgba(124, 58, 237, 0.1);
  --color-border:       rgba(0, 0, 0, 0.08);
  --color-deep:         #1a1a2e;
  --color-deep-light:   rgba(255, 255, 255, 0.1);
  --color-card:         #ffffff;

  /* Typography */
  --font-display: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;


  /* Type Scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  1.875rem;
  --text-3xl:  2.25rem;
  --text-4xl:  3rem;
  --text-5xl:  3.75rem;
  --text-hero: clamp(3.5rem, 9vw, 7rem);

  /* Spacing */
  --space-xs:   0.5rem;
  --space-sm:   0.75rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;
  --space-5xl:  8rem;
  --space-section: clamp(5rem, 12vh, 8rem);

  /* Layout */
  --max-width: 1200px;
  --gutter:    clamp(1.25rem, 4vw, 3rem);

  /* Motion */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --duration:      0.3s;
  --duration-slow: 0.6s;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  animation: pageFadeIn 0.5s ease-out;
}

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

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

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

::selection {
  background-color: var(--color-accent-soft);
  color: var(--color-deep);
}

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Fade-in Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

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

.fade-in-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.fade-in-stagger.is-visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.fade-in-stagger.is-visible > *:nth-child(2) { transition-delay: 0.08s; opacity: 1; transform: translateY(0); }
.fade-in-stagger.is-visible > *:nth-child(3) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.fade-in-stagger.is-visible > *:nth-child(4) { transition-delay: 0.16s; opacity: 1; transform: translateY(0); }
.fade-in-stagger.is-visible > *:nth-child(5) { transition-delay: 0.20s; opacity: 1; transform: translateY(0); }
.fade-in-stagger.is-visible > *:nth-child(6) { transition-delay: 0.24s; opacity: 1; transform: translateY(0); }

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-lg) 0;
  transition: background-color var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out),
              padding var(--duration) var(--ease-out);
}

.site-nav.is-scrolled {
  background-color: rgba(247, 247, 248, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--color-border);
  padding: var(--space-md) 0;
}


.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
}

.nav-links a {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  transition: color var(--duration) var(--ease-out);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-accent);
  transition: width var(--duration) var(--ease-out);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--color-text);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background-color: var(--color-text);
  transition: transform var(--duration) var(--ease-out),
              opacity var(--duration) var(--ease-out);
}

/* --- Hero Section --- */
.hero {
  min-height: 80vh;
  min-height: 80dvh;
  display: flex;
  align-items: center;
  padding: var(--space-5xl) 0 var(--space-4xl);
  position: relative;
  overflow: hidden;
  background: #f5f0eb;
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hero-content {
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 40px;
  height: 1.2em;
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeIn 0.8s var(--ease-out) 0.05s forwards;
}

/* Role cycling animation */
.hero-label-text {
  display: inline-block;
  position: relative;
}

.hero-label-text .role {
  display: inline-block;
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  animation: roleCycle 15s var(--ease-in-out) infinite;
}

.hero-label-text .role:nth-child(1) { animation-delay: 0s; }
.hero-label-text .role:nth-child(2) { animation-delay: 3s; }
.hero-label-text .role:nth-child(3) { animation-delay: 6s; }
.hero-label-text .role:nth-child(4) { animation-delay: 9s; }
.hero-label-text .role:nth-child(5) { animation-delay: 12s; }

@keyframes roleCycle {
  0%, 1%   { opacity: 0; transform: translateY(4px); }
  3%, 17%  { opacity: 1; transform: translateY(0); }
  20%, 100%{ opacity: 0; transform: translateY(-4px); }
}

.hero-headline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 600;
  line-height: 1.1;
  color: #1a1a2e;
  max-width: 600px;
  margin-bottom: var(--space-lg);
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeIn 0.8s var(--ease-out) 0.35s forwards;
}

.hero-credentials {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: #6b7280;
  margin-bottom: var(--space-2xl);
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeIn 0.8s var(--ease-out) 0.5s forwards;
}

.hero-credentials span {
  margin: 0 0.5em;
  opacity: 0.5;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  color: #1a1a2e;
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: var(--space-sm) var(--space-xl);
  border-radius: 6px;
  transition: color var(--duration) var(--ease-out),
              gap var(--duration) var(--ease-out),
              border-color var(--duration) var(--ease-out),
              background-color var(--duration) var(--ease-out);
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeIn 0.8s var(--ease-out) 0.65s forwards;
}

.hero-cta:hover {
  color: #1a1a2e;
  gap: var(--space-sm);
  border-color: rgba(0, 0, 0, 0.4);
  background-color: rgba(0, 0, 0, 0.04);
}

.hero-cta .arrow {
  display: inline-block;
  transition: transform var(--duration) var(--ease-out);
}

.hero-cta:hover .arrow {
  transform: translateY(3px);
}

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

/* --- Section Shared --- */
.section {
  padding: var(--space-section) 0;
}

#work {
  padding-top: var(--space-2xl);
  padding-bottom: 0;
}

.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-lg);
}

/* --- Project Cards --- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

.project-card {
  display: block;
  background: var(--color-card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: #1a1a2e;
  transition: box-shadow var(--duration) var(--ease-out),
              transform var(--duration) var(--ease-out),
              border-color var(--duration) var(--ease-out);
}

.project-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.project-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--color-border);
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}

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

/* Placeholder backgrounds for projects without images */
.project-card-image--meta {
  background: #f5f0eb;
}

.project-card-image--grab {
  background: #f5f0eb;
}

.project-card-image--grab img {
  object-position: center 70%;
}

.project-card-image--cashtree img {
  object-position: center calc(50% + 5px);
}

.project-card-image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card-image--placeholder .placeholder-label {
  font-family: var(--font-body);
  font-size: var(--text-3xl);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.01em;
}

.project-card-content {
  padding: var(--space-xl) var(--space-xl) var(--space-2xl);
}

.project-card-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: var(--space-sm);
}

.project-card-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #1a1a2e;
  margin-bottom: var(--space-sm);
  transition: color var(--duration) var(--ease-out);
}

.project-card-desc {
  font-size: var(--text-base);
  line-height: 1.6;
  color: #4b5563;
  margin-bottom: var(--space-lg);
  max-width: 560px;
}

.project-card-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  transition: gap var(--duration) var(--ease-out);
}

.project-card:hover .project-card-cta {
  gap: var(--space-sm);
}

/* --- About Section --- */
.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3xl);
}

.about-text {
  max-width: 640px;
}

.about-text p {
  font-size: var(--text-md);
  line-height: 1.75;
  color: #4b5563;
  margin-bottom: var(--space-lg);
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  justify-content: space-between;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
}

.skills-list li {
  font-size: var(--text-sm);
  color: #4b5563;
  position: relative;
  padding-left: var(--space-md);
}

.skills-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--color-accent);
  transform: translateY(-50%);
}

.company-logos {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xl) var(--space-2xl);
}

.company-logos .company-logo {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  letter-spacing: 0.02em;
  user-select: none;
}

.resume-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: var(--space-sm) var(--space-lg);
  border-radius: 6px;
  transition: background-color var(--duration) var(--ease-out),
              color var(--duration) var(--ease-out);
  width: fit-content;
}

.resume-link:hover {
  background-color: var(--color-accent);
  color: #ffffff;
}

/* --- Footer (replaces separate Contact section) --- */
.site-footer {
  background-color: var(--color-deep);
  color: #ffffff;
  padding: var(--space-2xl) 0 var(--space-2xl);
}

.footer-closing {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4xl);
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
  padding-bottom: var(--space-3xl);
  border-bottom: 1px solid var(--color-deep-light);
}

.footer-column-title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
}

.footer-column a {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
  transition: color var(--duration) var(--ease-out);
}

.footer-column a:hover {
  color: #ffffff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-xl);
}

.footer-credit {
  font-size: var(--text-xs);
  color: var(--color-muted);
  letter-spacing: 0.02em;
}

/* --- Passcode Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 10, 20, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  position: relative;
  background: var(--color-bg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 48px 40px 40px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.modal-desc {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-bottom: 28px;
}

.modal-input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  outline: none;
  margin-bottom: 12px;
  text-align: left;
  letter-spacing: 0.12em;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: var(--color-accent);
}

.modal-btn {
  display: block;
  width: 100%;
  padding: 14px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #fff;
  background-color: var(--color-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

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

.modal-error {
  display: none;
  margin-top: 16px;
  font-size: var(--text-xs);
  color: #ef4444;
}

/* --- Focus States --- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card--wide {
    grid-column: 1 / -1;
  }

  .project-card--wide .project-card-image {
    aspect-ratio: 2.2 / 1;
  }

  .project-card--wide .project-card-content {
    padding: var(--space-2xl);
  }

  .project-card--wide .project-card-title {
    font-size: var(--text-3xl);
  }

  .about-content {
    grid-template-columns: 1fr;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .about-content {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }

  .project-card-title {
    font-size: var(--text-3xl);
  }

  .project-card--wide .project-card-title {
    font-size: var(--text-4xl);
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(247, 247, 248, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xl);
    z-index: 99;
  }

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

  .nav-links a {
    font-size: var(--text-2xl);
    font-family: var(--font-display);
    text-transform: none;
    letter-spacing: -0.01em;
  }

  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 101;
  }

  .nav-toggle.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }

  .nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
  }

  .hero {
    min-height: 85vh;
    min-height: 85dvh;
  }

  .projects-grid {
    gap: var(--space-lg);
  }

  .project-card-content {
    padding: var(--space-lg);
  }

  .project-card-title {
    font-size: var(--text-xl);
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
