/* ==============================================
   NITS Brand Design System — Red Sun Edition
   Primary:   #EF4623 (Coral)
   Secondary: #2D3B42 (Ink)
   Accent:    #FDF1EE (Soft Peach)
   ============================================== */

/* ---------- Base ---------- */
body {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    scroll-behavior: smooth;
    color: #2D3B42;
}

h1,
h2,
h3,
h4,
.font-serif {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(28px) rotate(2deg);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

.fade-up {
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---------- Scroll Reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(30px) rotate(1deg);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

/* ---------- Ambient Blobs ---------- */
.blob {
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    animation: moveBlob 18s infinite alternate ease-in-out;
}

@keyframes moveBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(40px, 25px) scale(1.1);
    }

    100% {
        transform: translate(-25px, -45px) scale(0.92);
    }
}

/* ---------- Header Glassmorphism ---------- */
#header {
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}

#header.scrolled {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(45, 59, 66, 0.07);
}

/* ---------- Rotating Logo Mark ---------- */
.logo-mark {
    width: 36px;
    height: 36px;
    background: #EF4623;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(3deg);
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.logo-mark:hover {
    transform: rotate(12deg);
}

.logo-mark span {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-weight: 700;
    color: white;
    font-size: 18px;
    line-height: 1;
    display: block;
}

/* ---------- Flip Cards ---------- */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ---------- Tab System ---------- */
.tab-btn {
    color: rgba(45, 59, 66, 0.6);
    background: transparent;
    border: 1px solid transparent;
}

.tab-btn:hover {
    color: #2D3B42;
    background: rgba(45, 59, 66, 0.04);
}

.tab-btn.active {
    color: #FFFFFF;
    background: #2D3B42;
    box-shadow: 0 4px 14px rgba(45, 59, 66, 0.15);
}

.tab-content {
    display: grid;
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 10;
}

/* ---------- Mobile Menu ---------- */
#mobile-menu {
    display: none;
}

#mobile-menu.open {
    display: block;
}

/* ---------- Bento Cards ---------- */
.bento-card {
    border-radius: 48px;
    overflow: hidden;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.35s ease;
}

.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 64px rgba(239, 70, 35, 0.14);
}

.bento-card-dark {
    background: #2D3B42;
    color: white;
}

.bento-card-light {
    background: white;
    border: 1px solid rgba(45, 59, 66, 0.06);
}

.bento-card-peach {
    background: #FDF1EE;
}

/* Large background icon at 5% opacity */
.bento-icon-bg {
    position: absolute;
    bottom: -16px;
    right: -16px;
    width: 130px;
    height: 130px;
    opacity: 0.05;
    pointer-events: none;
}

/* ---------- Hero Background Pattern ---------- */
.hero-pattern {
    background-image: radial-gradient(rgba(45,59,66,0.05) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ---------- CTA Dot Pattern ---------- */
.dot-pattern {
    background-image: radial-gradient(rgba(255, 255, 255, 0.2) 1.5px, transparent 1.5px);
    background-size: 30px 30px;
}

/* ---------- UI Simulator ---------- */
.ui-simulator-window {
    background: #2D3B42;
    border-radius: 40px;
    overflow: hidden;
}

.ui-simulator-inner {
    background: white;
    border-radius: 28px;
    margin: 12px;
    overflow: hidden;
}

/* ---------- Solution Icon Container ---------- */
.solution-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FDF1EE;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.flip-card:hover .solution-icon-wrap {
    transform: scale(1.1);
}

/* ---------- Check List Item ---------- */
.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(45, 59, 66, 0.8);
}

.check-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FDF1EE;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---------- Form Fields ---------- */
.form-field {
    width: 100%;
    border: 1.5px solid rgba(45, 59, 66, 0.15);
    border-radius: 14px;
    padding: 12px 16px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.9rem;
    color: #2D3B42;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.form-field:focus {
    border-color: #EF4623;
    box-shadow: 0 0 0 3px rgba(239, 70, 35, 0.1);
}

.form-field::placeholder {
    color: rgba(45, 59, 66, 0.35);
}

/* ---------- Solution Tag Pill ---------- */
.solution-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1.5px solid;
}

/* ---------- Usecase Visual Panel ---------- */
.usecase-panel {
    background: #f8fafc;
    border-radius: 32px;
    border: 1px solid rgba(45, 59, 66, 0.07);
    overflow: hidden;
}

/* ---------- GNB Dropdown ---------- */
.gnb-dropdown-wrap {
    position: relative;
}

.gnb-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid rgba(45, 59, 66, 0.08);
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(45, 59, 66, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    min-width: 220px;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(-6px);
    z-index: 100;
}

/* Invisible bridge to prevent hover state from breaking */
.gnb-dropdown::before {
    content: "";
    position: absolute;
    top: -24px;
    left: 0;
    width: 100%;
    height: 24px;
    background: transparent;
}

.gnb-dropdown-wrap:hover .gnb-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.gnb-dropdown a {
    display: block;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(45, 59, 66, 0.85);
    border-radius: 12px;
    transition: background 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s cubic-bezier(0.16, 1, 0.3, 1), padding-left 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gnb-dropdown a:hover {
    background: #FDF1EE;
    color: #EF4623;
    padding-left: 22px;
}

.gnb-dropdown-divider {
    height: 1px;
    background: rgba(45, 59, 66, 0.07);
    margin: 6px 8px;
}

/* ---------- GNB 3-depth Sub Menu ---------- */
.gnb-sub-wrap {
    position: relative;
}
.gnb-sub-trigger {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px;
}
.gnb-sub-trigger .sub-caret {
    font-size: 0.7rem;
    opacity: 0.4;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.gnb-sub-wrap:hover .gnb-sub-trigger .sub-caret {
    opacity: 1;
}
.gnb-sub-dropdown {
    position: absolute;
    top: -8px;
    left: calc(100% + 10px);
    background: white;
    border: 1px solid rgba(45, 59, 66, 0.08);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(45, 59, 66, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    min-width: 180px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 101;
}
.gnb-sub-dropdown::before {
    content: "";
    position: absolute;
    top: 0;
    left: -14px;
    width: 14px;
    height: 100%;
    background: transparent;
}
.gnb-sub-wrap:hover .gnb-sub-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ---------- Mobile Accordion ---------- */
.mobile-accordion-body,
.mobile-sub-body {
    display: none;
}
.mobile-accordion-body.open,
.mobile-sub-body.open {
    display: block;
}

/* ---------- Product Page: Hero Band ---------- */
.product-hero {
    background: #2D3B42;
    padding: 140px 0 60px;
}

/* ---------- Product Page: Tab Nav (상단 제품 탭) ---------- */
.product-tab-nav {
    background: white;
    border-bottom: 1px solid rgba(45, 59, 66, 0.08);
    position: sticky;
    top: 73px;
    z-index: 40;
}

.product-tab-link {
    display: inline-block;
    padding: 18px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(45, 59, 66, 0.55);
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.product-tab-link:hover {
    color: #2D3B42;
}

.product-tab-link.active {
    color: #EF4623;
    border-bottom-color: #EF4623;
}

/* ---------- Product Page: Feature Card ---------- */
.feature-card {
    background: white;
    border: 1px solid rgba(45, 59, 66, 0.07);
    border-radius: 24px;
    padding: 32px;
    transition: box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover {
    box-shadow: 0 12px 40px rgba(45, 59, 66, 0.08);
    transform: translateY(-3px);
}

.feature-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #FDF1EE;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* ---------- Product Page: System Diagram ---------- */
.sys-diagram-box {
    background: white;
    border: 1px solid rgba(45, 59, 66, 0.1);
    border-radius: 16px;
    padding: 20px 24px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #2D3B42;
    min-width: 96px;
}

.sys-diagram-box.highlight {
    background: #EF4623;
    color: white;
    border-color: #EF4623;
}

.sys-diagram-box.dark {
    background: #2D3B42;
    color: white;
    border-color: #2D3B42;
}

.sys-arrow {
    color: rgba(45, 59, 66, 0.3);
    font-size: 1.4rem;
    flex-shrink: 0;
}