/* ============================================
   SARAM Architects — Custom Styles
   Color Palette from Design Guide:
   - Breath Beige: #E8E0D2
   - Zinc Blue-Grey: #858D8B
   - Deck Wood: #8D6E52
   - Gallery White: #FAFAFA
   - Dark-Green night: #819872
   - Dark Gray: #232323
   ============================================ */

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

::selection {
    background: #E8E0D2;
    color: #232323;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
}

/* Hide scrollbar */
body::-webkit-scrollbar {
    width: 6px;
}

body::-webkit-scrollbar-track {
    background: #FAFAFA;
}

body::-webkit-scrollbar-thumb {
    background: #E8E0D2;
    border-radius: 3px;
}

body::-webkit-scrollbar-thumb:hover {
    background: #858D8B;
}

/* --- Navigation --- */
#main-nav {
    background: rgba(250, 250, 250, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#main-nav.scrolled {
    border-bottom: 1px solid #E8E0D2;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #8D6E52;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* --- Mobile Menu --- */
#mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
}

#menu-toggle.open .menu-bar:first-child {
    transform: rotate(45deg) translate(2px, 2px);
}

#menu-toggle.open .menu-bar:last-child {
    transform: rotate(-45deg) translate(2px, -2px);
}

/* --- Animations --- */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

.animate-slide-up {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Project Cards --- */
.project-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.project-card:nth-child(1) {
    animation-delay: 0.05s;
}

.project-card:nth-child(2) {
    animation-delay: 0.1s;
}

.project-card:nth-child(3) {
    animation-delay: 0.15s;
}

.project-card:nth-child(4) {
    animation-delay: 0.2s;
}

.project-card:nth-child(5) {
    animation-delay: 0.25s;
}

.project-card:nth-child(6) {
    animation-delay: 0.3s;
}

.project-card:nth-child(7) {
    animation-delay: 0.35s;
}

.project-card:nth-child(8) {
    animation-delay: 0.4s;
}

.project-card:nth-child(9) {
    animation-delay: 0.45s;
}

.project-card:nth-child(10) {
    animation-delay: 0.5s;
}

.project-card:nth-child(11) {
    animation-delay: 0.55s;
}

.project-card:nth-child(12) {
    animation-delay: 0.6s;
}

/* Filter transition */
.project-card.hidden-filter {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Filter Buttons --- */
.filter-btn.active {
    background: #232323;
    color: #FAFAFA;
    border-color: #232323;
}

/* --- Line Hierarchy (from Design Guide) --- */
.line-l1 {
    /* Level 1: Outline — 3px */
    border-width: 3px;
    border-color: #232323;
}

.line-l2 {
    /* Level 2: Structure — 1.5px */
    border-width: 1.5px;
    border-color: #232323;
}

.line-l3 {
    /* Level 3: Texture — 1px */
    border-width: 1px;
    border-color: #858D8B;
}

/* --- Form Styles --- */
input:focus,
textarea:focus {
    outline: none;
}

/* --- Line Clamp --- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
    .hero-title span span {
        font-size: clamp(2.5rem, 10vw, 4.5rem);
    }
}

/* --- Page transition --- */
#main-content {
    animation: fadeIn 0.4s ease forwards;
}

/* ============================================
   Typography Hierarchy (from Design Guide PDF)
   인지심리학적 위계: 배경(안전) → 구조(신뢰) → 강조(따뜻함)

   Color usage:
   - Background/안전: #FAFAFA (Gallery White) - 페이지 배경
   - Structure/신뢰: #858D8B (Zinc Blue-Grey) - 부제목, 메타정보, 보조텍스트
   - Emphasis/따뜻함: #8D6E52 (Deck Wood) - 강조, 호버, 액센트
   - Primary text: #232323 (Dark Gray) - 본문, 제목
   - Warm base: #E8E0D2 (Breath Beige) - 구분선, 배경 액센트
   - Nature: #819872 (Dark-Green night) - 상태 표시, 특수 강조
   ============================================ */

/* Text Hierarchy Classes */
.text-hierarchy-title {
    color: #232323;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.text-hierarchy-subtitle {
    color: #858D8B;
    font-weight: 300;
    letter-spacing: 0.05em;
    line-height: 1.5;
}

.text-hierarchy-body {
    color: #232323;
    font-weight: 400;
    line-height: 1.7;
}

.text-hierarchy-caption {
    color: #858D8B;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

.text-hierarchy-accent {
    color: #8D6E52;
    font-weight: 500;
}

/* Section dividers using line hierarchy */
.divider-l1 {
    height: 3px;
    background: #232323;
}

.divider-l2 {
    height: 1.5px;
    background: #E8E0D2;
}

.divider-l3 {
    height: 1px;
    background: #E8E0D2;
}

/* ============================================
   Project Content - Blog Style (Naver-like)
   Summernote HTML 콘텐츠 렌더링 스타일
   ============================================ */
.project-content {
    font-size: 15px;
    line-height: 1.9;
    color: #232323;
    word-break: keep-all;
}

.project-content p {
    margin-bottom: 16px;
}

.project-content h2 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 32px 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E8E0D2;
    color: #232323;
}

.project-content h3 {
    font-size: 1.15em;
    font-weight: 600;
    margin: 24px 0 10px;
    color: #232323;
}

.project-content h4 {
    font-size: 1.05em;
    font-weight: 600;
    margin: 20px 0 8px;
    color: #858D8B;
}

.project-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
}

.project-content blockquote {
    border-left: 3px solid #8D6E52;
    padding: 12px 20px;
    margin: 20px 0;
    background: rgba(232, 224, 210, 0.15);
    color: #858D8B;
    font-style: italic;
}

.project-content ul,
.project-content ol {
    padding-left: 24px;
    margin: 12px 0;
}

.project-content li {
    margin: 6px 0;
}

.project-content ul li {
    list-style-type: disc;
}

.project-content ol li {
    list-style-type: decimal;
}

.project-content a {
    color: #8D6E52;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.project-content a:hover {
    color: #232323;
}

.project-content hr {
    border: none;
    border-top: 1px solid #E8E0D2;
    margin: 32px 0;
}

.project-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.project-content table th,
.project-content table td {
    border: 1px solid #E8E0D2;
    padding: 10px 12px;
    text-align: left;
}

.project-content table th {
    background: rgba(232, 224, 210, 0.3);
    font-weight: 600;
    color: #858D8B;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-content iframe,
.project-content video {
    max-width: 100%;
    margin: 20px 0;
    border-radius: 4px;
}

.project-content strong {
    font-weight: 600;
}

.project-content em {
    font-style: italic;
}