/* 
 * TITAN STATION - Premium Space Theme
 * 
 * [Project Overview]
 * Titan Station main portal designed for a futuristic and immersive Web3 experience.
 * 
 * [Technical Features]
 * 1. Theme: Dynamic animation background based on Space theme
 * 2. Identity: Applied Glassmorphism and Neon Gradient points
 * 3. Interaction: Kinetic Typography (Sliding Title) and Smooth Scroll Navigation
 * 4. Flexibility: Fully responsive layout using CSS Grid and Viewport-based fonts (clamp)
 */



/* Global Reset & Base Styles Overrides */
html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Prevent responsive horizontal overflow: Block horizontal scrolling caused by off-screen content (margin-left, etc.) */
    overflow-x: hidden;
}

body {
    background-color: var(--bg-deep);
    /* Deep Space Gradient Background */
    background-image: url('../assets/images/hero/background-cosmic.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-main);
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    /* Changed to Poppins for readability */
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Starry Background Animation */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* More stars, brighter and denser */
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 40px 70px, #ffffff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(white, rgba(255, 255, 255, .3) 2px, transparent 4px),
        radial-gradient(white, rgba(255, 255, 255, .2) 1px, transparent 2px);
    background-size: 200px 200px, 350px 350px, 250px 250px, 150px 150px, 400px 400px, 550px 550px, 300px 300px;
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px, 20px 20px, 0 0, 100px 100px;
    opacity: 1;
    /* Maximized brightness */
    z-index: -1;
    animation: moveStars 100s linear infinite;
}

@keyframes moveStars {
    from {
        background-position: 0 0, 40px 60px, 130px 270px, 70px 100px, 20px 20px, 0 0, 100px 100px;
    }

    to {
        background-position: 550px 550px, 590px 610px, 680px 820px, 620px 650px, 570px 570px, 550px 550px, 650px 650px;
    }
}

/* Container Utility */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Typography Enhancements */
h1,
h2,
h3 {
    font-family: 'Space Grotesk', sans-serif;
    /* Explicitly set Display font */
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
    color: var(--text-main);
}

.title {
    font-size: 2.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    display: block;
    text-align: center;
    width: 100%;
    margin-bottom: 3rem;
    position: relative;
}

.title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 12px var(--primary-glow);
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 100;
    /* Ensure minimum presence */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 5%;
    /* Vertical padding for natural height */
    background: rgba(5, 6, 20, 0.7);
    backdrop-filter: blur(12px);
    /* border-bottom: 1px solid var(--glass-border); Removed border */
    transition: var(--transition-smooth);
}

.hamburger {
    display: none;
    /* Hidden on desktop */
}

header h1 {
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
}

/* 로고 이미지 + 텍스트 가로 정렬 */
header h1 a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    /* 그라데이션 텍스트 상속 */
    background: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 로고 아이콘 스타일 */
.titan-station-logo {
    aspect-ratio: 1 / 1;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

nav ul {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

nav a {
    text-decoration: none;
    font-weight: 500;
    color: var(--text-sub);
    position: relative;
    transition: 0.3s;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
}

/* 키보드 접근성: Tab 키 포커스 시에만 아웃라인 표시 (마우스 클릭 시 미노출) */
nav a:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 4px;
    border-radius: 2px;
}

nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--secondary);
    box-shadow: 0 0 8px var(--secondary);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effect for desktop only */
nav a:hover {
    color: var(--text-main);
}

nav a:hover::before {
    width: 100%;
}

/* Hero Section */
.hero {
    /* 1. 화면 전체 높이 사용 및 내용물 하단 정렬 */
    display: flex;
    align-items: flex-end;
    /* 세로: 하단 정렬 */
    /* justify-content: center; */
    /* 가로: 중앙 정렬 (컨테이너가 가운데 오도록) */
    position: relative;
    overflow: hidden;
    margin-bottom: 120px;
    height: 100vh;
}

/* Vignette Overlay for Text Visibility */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 20%, rgba(5, 6, 20, 0.6) 80%);
    pointer-events: none;
    z-index: 1;
}

/* Hero Container Specific Styles */
.hero .container {
    width: 100%;
    /* 컨테이너 너비 확보 */
    height: 100%;
    /* 높이 확보하여 내부 flex-end 정렬 가능하게 함 */
    display: flex;
    justify-content: center;
    align-items: center;
    /* 컨테이너 내부에서도 하단 정렬 */
}

.hero-content {
    /* max-width: 900px;  삭제: 중앙 정렬을 위해 너비 제한 해제 */
    width: 100%;
    /* text-align: left; 삭제: Flexbox 제어로 변경 */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 중앙 정렬 */
    position: relative;
    z-index: 2;
}

/* 1. Kinetic Typography Semantic H2 */
.kinetic-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 0.9;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
    /* 드래그 방지 */
    user-select: none;
    /* 추가: 너비 문제 해결을 위한 Flexbox 설정 */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 중앙 정렬 */
    /* overflow: hidden; 삭제: 텍스트 잘림 방지 */
}

/* Animation Keyframes */
@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animation Classes */
.slide-in-left {
    animation: slideInLeft 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.slide-in-right {
    animation: slideInRight 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.kinetic-title .row {
    display: flex;
    /* 가로 나열 */
    gap: 0.25em;
    /* 텍스트 사이 간격 */
    white-space: nowrap;
    width: fit-content;
}

/* Common Text Styles */
.kinetic-title span {
    display: block;
    /* 폰트 사이즈 확대: clamp(3rem, ...) -> clamp(4.5rem, ...) */
    font-size: clamp(4.5rem, 8vw, 7.5rem);
    line-height: 1;
}

/* Main Text Style (Center) */
.kinetic-title .main {
    color: #fff;
    font-weight: 700;
}

/* Outline Text Style (Dummies) */
.kinetic-title .outline {
    color: transparent;
    /* 스트록 두께 축소: 1px -> 0.5px */
    -webkit-text-stroke: 0.5px #fff;
    font-weight: 700;
}

/* Staggered Layout & Positioning */
/* 
   더미 텍스트(Outline)가 왼쪽에 2개 추가되었으므로, 
   Main 텍스트가 원래 위치에 오려면 왼쪽으로 크게 당겨야 함(- margin-left) 
*/

/* Row 1: WELCOME TO */
.kinetic-title .row-1 {
    /* 중앙 기준 약간 왼쪽으로 이동 (Balance) */
    /* 수정한 부분: vw(뷰포트 기준) -> %(컨테이너 기준) 변경하여 이탈 방지 */
    margin-left: -5%;
}

/* Row 2: TITAN STATION (Main) */
.kinetic-title .row-2 {
    /* Main 줄 강조를 위해 폰트 사이즈 더 확대 */
    font-size: clamp(5.5rem, 9vw, 8.5rem);
    /* 중앙 정렬 (이동 없음) */
    margin-left: 0;
}

.kinetic-title .row-2 span {
    font-size: inherit;
    /* 부모 폰트 사이즈 상속 */
}

/* Row 2의 outline 두께 조정 (폰트가 커서 얇아 보이는 현상 해결) */
.kinetic-title .row-2 .outline {
    -webkit-text-stroke: 0.6px #fff;
}

/* Row 3: HUB */
.kinetic-title .row-3 {
    /* 중앙 기준 약간 오른쪽으로 이동 (Balance) */
    margin-left: 10%;
}


/* 2. Hero Services Section Layout */
.hero-services {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4rem;
    width: 100%;
    /* Step 8: padding-top 후 shorthand로 덮어씌워지는 충돌 해소 — 개별 속성으로 분리 */
    padding-top: 2rem;
    padding-left: 40px;
    padding-right: 40px;
    padding-bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.service-header h3 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    margin: 0;
}

.service-list ul {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0;
    margin: 0;
    list-style: none;
}



.service-list a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    position: relative;
    transition: 0.3s;
    display: inline-block;
}

.service-list a:hover {
    color: var(--secondary);
    /* 네온 색상(청록색)으로 롤백 */
}



/* Hero Deco - Glowing Planet Effect behind text */
.hero-deco {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(125, 92, 255, 0.1) 0%, transparent 60%);
    filter: blur(60px);
    z-index: -1;
    pointer-events: none;
}

/* Main Content Layout */
section.container {
    padding-bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: 120px;
    /* Space between Articles */
}

/* Glass Cards System */
article {
    background: transparent;
    /* Reset from old design */
    border: none;
    box-shadow: none;
    padding: 0;
    scroll-margin-top: 15vh;
    /* Offset for navigation scroll position */
}

.grid-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.grid-box.single {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.box {
    background: rgba(13, 14, 33, 0.7);
    /* Darker, more opaque background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(125, 92, 255, 0.2);
    /* Subtle purple border match */
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    /* Padding moved to box/content container */
    position: relative;
    transition: var(--transition-smooth);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    /* Better depth */
}

.box:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* New Layout Structure */
.box .content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.title-wrap h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Icon inside H3 */
.icon-placeholder {
    aspect-ratio: 1 / 1;
    width: 40px;
    /* Adjusted size for title alignment */
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(125, 92, 255, 0.2), rgba(34, 211, 238, 0.2));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
    flex-shrink: 0;
    padding: 3px;
}

.icon-placeholder.dragon-icon {
    padding: 1px;
}

.dragon-icon img {
    width: 100%;
}

.icon-placeholder.solana-icon {
    padding: 6px;
}

/* wallet-icon 컨테이너 강제 정사각형 고정 (40x40) */
.icon-placeholder.wallet-icon {
    height: 40px;
    /* aspect-ratio만으로는 내부 컨텐츠에 의해 늘어날 수 있으므로 명시적 높이 설정 */
    overflow: hidden;
    /* 넘치는 내용 숨김 */
    padding: 5px;
}

/* wallet-icon 내부 SVG를 감싸는 span - 부모 높이 100% 채움 */
.icon-placeholder.wallet-icon>span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

/* wallet-icon 내부 SVG 크기 조정: 부모 높이 100% + 39:43 비율 유지 */
.icon-placeholder.wallet-icon svg {
    height: 100%;
    width: auto;
    /* 비율 유지하며 자동 조정 */
    display: block;
    /* inline 기본값으로 인한 여백 제거 */
    max-width: 100%;
    /* 가로도 부모를 넘지 않도록 */
}

.icon-placeholder.metamask-icon {
    padding: 6px;
}

.box:hover .icon-placeholder {
    transform: scale(1.1) rotate(5deg);
    background: rgba(0, 0, 0, 0);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0);
}

/* Link Button with Chevron */
.link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    /* Subtle background for better hit area visibility */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Subtle border */
    border-radius: 50%;
    /* Circle shape again for better UI affordance */
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.link::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #fff;
    /* Always white for visibility */
    border-top: 2px solid #fff;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-right: 3px;
    margin-top: 1px;
}

/* 1. 화살표 버튼 호버 시 버튼 자체가 커지는(scale) 효과를 제거하여 내부 화살표 고정 */
.link:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: none;
}

.box p {
    color: #e2e8f0;
    /* Even brighter silver for body text */
    line-height: 1.7;
}

/* Hover Gradient Overlay */
.box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.box:hover::before {
    opacity: 1;
}

/* Footer Details - Minimalist */
footer {
    text-align: center;
    padding: 4rem 1rem;
    border-top: 1px solid var(--glass-border);
    background: #02030a;
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 4rem;
}

/* Scroll Animation Classes */
.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 7. Toast Notification */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(13, 14, 33, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--secondary);
    color: var(--text-main);
    padding: 1.25rem 4rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(34, 211, 238, 0.3);
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Solscan Icon specific padding */
.icon-placeholder.solscan-icon {
    padding: 5px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(125, 92, 255, 0.2));
}

/* 반응형 스타일은 responsive.css에서 일괄 관리합니다 (ADR-005 Step 6) */