/* ==========================================================================
   HEUNTA — 3D Artist & Visual Designer Portfolio
   Fonts: Futura & Pretendard
   Palette: Warm Ivory (#F6F3EC) & Pure Ink (#111111)
   Aesthetic: Minimalist, Editorial, Authentic Designer Portfolio
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --bg: #f6f3ec;
  --bg-subtle: #eee9df;
  --bg-card: #eae4d7;
  --bg-modal: #faf8f4;
  --text: #111111;
  --text-muted: #66635e;
  --text-subtle: #99948c;
  --border: rgba(17, 17, 17, 0.1);
  --border-strong: rgba(17, 17, 17, 0.25);
  
  --font-main: "Futura", "Futura PT", -apple-system, "Pretendard", sans-serif;
  --font-sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-w: 1280px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

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

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

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

/* ---------- Subtle Film Grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' seed='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------- Container Framework ---------- */
.site-header,
.hero,
.projects-section,
.contact-section,
.site-footer,
.project-detail-main {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 236, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-logo {
  height: 32px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  display: block;
  transition: opacity 150ms ease, transform 150ms ease;
}

.brand:hover .brand-logo {
  opacity: 0.75;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: color 150ms ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-external {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Hero Section (with Bold Side Emblem) ---------- */
.hero {
  padding-top: clamp(60px, 9vw, 110px);
  padding-bottom: clamp(50px, 7vw, 90px);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.55fr);
  align-items: center;
  gap: 48px;
}

.hero-content {
  max-width: 820px;
}

.hero-title {
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
}

.hero-location {
  margin-top: 18px;
  font-size: 0.92rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Hero Large Logo Frame */
.hero-logo-frame {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.hero-emblem {
  width: clamp(140px, 16vw, 220px);
  height: auto;
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.06));
  transition: transform 400ms var(--ease), opacity 200ms ease;
}

.hero-emblem:hover {
  transform: scale(1.04) rotate(-1.5deg);
  opacity: 0.9;
}

/* ---------- Projects Section ---------- */
.projects-section {
  padding-bottom: clamp(60px, 10vw, 120px);
}

.projects-toolbar {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.toolbar-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

/* Projects Grid - 2 Column Clean Alignment */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 32px;
}

.project-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
}

.project-media-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
}

.project-media-box img {
  transition: transform 450ms var(--ease), opacity 300ms ease;
}

.project-item:hover .project-media-box img {
  transform: scale(1.02);
  opacity: 0.92;
}

/* Fallback Card for missing images */
.project-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: var(--bg-card);
}

.project-fallback.is-active {
  display: flex;
}

.fallback-info {
  display: grid;
  gap: 4px;
}

.fallback-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.fallback-hint {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  transition: opacity 150ms ease;
}

.project-item:hover .project-title {
  opacity: 0.7;
}

.project-year {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ---------- Contact Section ---------- */
.contact-section {
  padding-bottom: clamp(80px, 12vw, 140px);
  border-top: 1px solid var(--border);
  padding-top: clamp(60px, 8vw, 100px);
}

.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: start;
}

.sub-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

.contact-headline {
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.contact-desc {
  margin-top: 16px;
  max-width: 480px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  line-height: 1.7;
}

.contact-links {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 200ms ease, opacity 150ms ease;
}

.contact-row:hover {
  padding-left: 8px;
  opacity: 0.7;
}

.row-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.row-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.row-arrow {
  font-size: 1.1rem;
  color: var(--text-subtle);
}

/* ==========================================================================
   Project Detail Page (project.html) & Behance-style Canvas
   ========================================================================== */
.project-detail-main {
  padding-top: clamp(40px, 6vw, 70px);
  padding-bottom: clamp(80px, 12vw, 140px);
}

.detail-back-bar {
  margin-bottom: 28px;
}

.back-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: color 150ms ease;
}

.back-link:hover {
  color: var(--text);
}

.detail-header {
  margin-bottom: 32px;
  max-width: 960px;
}

.detail-year {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-title {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* Detail Top Meta Grid */
.detail-meta-grid {
  display: grid;
  grid-template-columns: 180px 240px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
  align-items: start;
}

.detail-meta-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 600;
}

.meta-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.detail-tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tool-tag {
  font-size: 0.82rem;
  padding: 3px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text);
}

.detail-overview-text {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}

/* Behance Style Dynamic Content Blocks Feed */
.detail-blocks-canvas {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 6vw, 72px);
  margin-bottom: 72px;
}

.canvas-block {
  width: 100%;
  margin: 0;
}

.block-image-frame {
  position: relative;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.block-image-frame img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  background: #111111;
}

.block-video-frame {
  position: relative;
  width: 100%;
  background: #111111;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.block-video-frame video {
  width: 100%;
  height: auto;
  max-height: 85vh;
  display: block;
}

.block-embed-frame {
  aspect-ratio: 16 / 9;
}

.block-embed-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.block-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-sans);
}

.canvas-block-text {
  max-width: 820px;
  margin-inline: auto;
  padding: 16px 0;
}

.editorial-text {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.85;
  color: var(--text);
}

.editorial-text p {
  margin-bottom: 20px;
}

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

.grid-two-frame {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-col {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.grid-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.block-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: var(--bg-card);
  gap: 8px;
}

/* Next Project Link */
.detail-next-nav {
  padding-top: 48px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.next-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 600;
}

.next-project-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: opacity 150ms ease, transform 200ms ease;
  width: fit-content;
}

.next-project-link:hover {
  opacity: 0.7;
  transform: translateX(6px);
}

.next-arrow {
  font-size: 1.8rem;
  transition: transform 200ms ease;
}

.next-project-link:hover .next-arrow {
  transform: translateX(4px);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 28px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-logo-frame {
    justify-content: flex-start;
  }

  .hero-emblem {
    width: 140px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .contact-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .grid-two-frame {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .projects-toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
  }
}
