/* ============================================
   hangul.dev - Navy Metallic Portfolio
   ============================================ */

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga' 1, 'kern' 1;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    background-color: #080E1A;
    color: #7B92B8;
    overflow-x: hidden;
}

/* --- Scroll Container --- */
.scroll-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

/* --- Sections --- */
.section {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 48px 48px 96px;
    transition: opacity 0.5s ease;
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 56px;
    color: #C5CED9;
    letter-spacing: -0.02em;
    margin-bottom: 48px;
    font-variant-caps: small-caps;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 48px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    z-index: 100;
    background: linear-gradient(135deg, #0D1321, #1B2340);
    border-right: 1px solid #1B2340;
}

.nav-indicator {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2A3454;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 0px rgba(123, 146, 184, 0);
}

.nav-indicator.active .nav-dot {
    background: #7B92B8;
    box-shadow: 0 0 8px rgba(123, 146, 184, 0.6);
}

.nav-indicator:hover .nav-dot {
    transform: scale(1.3);
    background: #7B92B8;
    box-shadow: 0 0 8px rgba(123, 146, 184, 0.4);
}

.nav-label {
    position: absolute;
    left: 24px;
    font-family: 'EB Garamond', Georgia, serif;
    font-variant-caps: small-caps;
    font-size: 12px;
    color: #C5CED9;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
    pointer-events: none;
    background: #0D1321;
    padding: 4px 10px;
    border: 1px solid #1B2340;
    border-radius: 2px;
}

.nav-indicator:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

/* LED pulse animation for active indicator */
@keyframes ledPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(123, 146, 184, 0.4); }
    50% { box-shadow: 0 0 8px rgba(123, 146, 184, 0.8); }
}

.nav-indicator.active .nav-dot {
    animation: ledPulse 4s ease-in-out infinite;
}

/* ============================================
   SECTION 1: COMMAND DECK (HERO)
   ============================================ */
.section-command {
    background: #080E1A;
    align-items: flex-start;
    padding-left: 96px;
    overflow: hidden;
}

.hero-leather-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 60%;
    opacity: 0.20;
    background:
        repeating-linear-gradient(
            45deg,
            #3A2F1F 0px,
            #3A2F1F 1px,
            transparent 1px,
            transparent 3px
        ),
        repeating-linear-gradient(
            -30deg,
            #4A3828 0px,
            #4A3828 1px,
            transparent 1px,
            transparent 5px
        ),
        linear-gradient(135deg, #3A2F1F 0%, #2A1F12 50%, #3A2F1F 100%);
    pointer-events: none;
}

.command-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
}

.hero-title {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 72px;
    color: #E8ECF1;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0;
}

.hero-rule {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 61.8vh;
    margin-top: calc(61.8vh - 200px);
    width: 100%;
    max-width: 700px;
}

.hero-rule .rule-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #4A5568, #7B92B8, #4A5568);
}

.system-readout {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #7B92B8;
    margin-top: 24px;
    letter-spacing: 0.05em;
}

.readout-sep {
    color: #4A5568;
    margin: 0 12px;
}

/* ============================================
   SECTION 2: ARSENAL (PORTFOLIO GRID)
   ============================================ */
.section-arsenal {
    background: #080E1A;
    padding-top: 80px;
    padding-bottom: 80px;
    min-height: 100vh;
    height: auto;
    justify-content: flex-start;
    align-items: center;
}

/* Grid overlay - faint blueprint lines */
.grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
    background:
        repeating-linear-gradient(
            90deg,
            #1B2340 0px,
            #1B2340 1px,
            transparent 1px,
            transparent calc(100% / 12)
        ),
        repeating-linear-gradient(
            0deg,
            #1B2340 0px,
            #1B2340 1px,
            transparent 1px,
            transparent 100px
        );
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    width: 100%;
}

.portfolio-tile {
    position: relative;
    background: #0D1321;
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, #3A2F1F, #4A5568) 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(8, 14, 26, 0.3);
    min-height: 180px;
    overflow: hidden;
}

.tile-2x2 {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 384px;
}

.tile-2x1 {
    grid-column: span 2;
    min-height: 180px;
}

.tile-1x1 {
    min-height: 180px;
}

.portfolio-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(8, 14, 26, 0.5);
    border-image: linear-gradient(135deg, #C9A96E, #C9A96E) 1;
}

/* HUD Corner Brackets */
.tile-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tile-corner::before,
.tile-corner::after {
    content: '';
    position: absolute;
    background: #7B92B8;
    transition: background 0.4s ease;
}

.tile-corner.tl { top: 4px; left: 4px; }
.tile-corner.tl::before { top: 0; left: 0; width: 16px; height: 2px; }
.tile-corner.tl::after { top: 0; left: 0; width: 2px; height: 16px; }

.tile-corner.tr { top: 4px; right: 4px; }
.tile-corner.tr::before { top: 0; right: 0; width: 16px; height: 2px; }
.tile-corner.tr::after { top: 0; right: 0; width: 2px; height: 16px; }

.tile-corner.bl { bottom: 4px; left: 4px; }
.tile-corner.bl::before { bottom: 0; left: 0; width: 16px; height: 2px; }
.tile-corner.bl::after { bottom: 0; left: 0; width: 2px; height: 16px; }

.tile-corner.br { bottom: 4px; right: 4px; }
.tile-corner.br::before { bottom: 0; right: 0; width: 16px; height: 2px; }
.tile-corner.br::after { bottom: 0; right: 0; width: 2px; height: 16px; }

.portfolio-tile:hover .tile-corner.tl { top: 2px; left: 2px; }
.portfolio-tile:hover .tile-corner.tr { top: 2px; right: 2px; }
.portfolio-tile:hover .tile-corner.bl { bottom: 2px; left: 2px; }
.portfolio-tile:hover .tile-corner.br { bottom: 2px; right: 2px; }

.portfolio-tile:hover .tile-corner::before,
.portfolio-tile:hover .tile-corner::after {
    background: #C9A96E;
}

.tile-content {
    position: relative;
    z-index: 2;
}

.tile-title {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 24px;
    color: #C5CED9;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.tile-desc {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 16px;
    color: #7B92B8;
    line-height: 1.6;
}

.tile-hud {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #4A5568;
    letter-spacing: 0.05em;
    margin-top: 16px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.portfolio-tile:hover .tile-hud {
    opacity: 1;
    transform: translateY(0);
}

/* Grid coordinate labels */
.portfolio-tile::before {
    content: attr(data-coords);
    position: absolute;
    top: -14px;
    left: -2px;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: #1B2340;
    z-index: 1;
}

/* Status indicator dots */
.tile-content::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #5B7A6A;
    margin-bottom: 12px;
    animation: statusPulse 4s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0px rgba(91, 122, 106, 0.3); }
    50% { box-shadow: 0 0 4px rgba(91, 122, 106, 0.7); }
}

/* Featured tile badge */
.tile-2x2 .tile-content::before {
    background: #D4943A;
    animation: featuredPulse 4s ease-in-out infinite;
}

@keyframes featuredPulse {
    0%, 100% { box-shadow: 0 0 0px rgba(212, 148, 58, 0.3); }
    50% { box-shadow: 0 0 4px rgba(212, 148, 58, 0.7); }
}

/* ============================================
   SECTION 3: MANIFEST (ABOUT)
   ============================================ */
.section-manifest {
    background: #080E1A;
    flex-direction: column;
    align-items: center;
}

.leather-divider {
    width: 100%;
    max-width: 640px;
    margin-bottom: 48px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.divider-metal-line {
    height: 1px;
    background: #4A5568;
}

.divider-leather-strip {
    height: 4px;
    background:
        repeating-linear-gradient(
            90deg,
            #3A2F1F 0px,
            #3A2F1F 2px,
            #4A3828 2px,
            #4A3828 5px,
            #3A2F1F 5px,
            #3A2F1F 8px,
            #352A1A 8px,
            #352A1A 11px
        );
}

.manifest-content {
    max-width: 640px;
    width: 100%;
    text-align: left;
}

.manifest-content .section-heading {
    text-align: center;
}

.manifest-content p {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 20px;
    color: #7B92B8;
    line-height: 1.85;
    margin-bottom: 28px;
}

.manifest-content p:last-child {
    margin-bottom: 0;
}

.manifest-content em {
    color: #C9A96E;
    font-style: italic;
}

/* ============================================
   SECTION 4: TRANSMISSIONS (WRITING/BLOG)
   ============================================ */
.section-transmissions {
    background: #080E1A;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

/* CRT scan lines */
.scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 3px,
        #1B2340 3px,
        #1B2340 4px
    );
    opacity: 0.08;
}

.transmissions-list {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #1B2340;
    border-bottom: 1px solid #1B2340;
}

.transmission-entry {
    display: flex;
    align-items: center;
    padding: 20px 16px;
    border-bottom: 1px solid #1B2340;
    text-decoration: none;
    transition: background 0.3s ease;
    gap: 20px;
}

.transmission-entry:last-child {
    border-bottom: none;
}

.transmission-entry:hover {
    background: #0D1321;
}

.transmission-date {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #4A5568;
    flex-shrink: 0;
    width: 100px;
}

.transmission-title {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 18px;
    color: #7B92B8;
    flex: 1;
    transition: color 0.3s ease;
}

.transmission-entry:hover .transmission-title {
    color: #C9A96E;
}

.transmission-arrow {
    font-size: 18px;
    color: #4A5568;
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.transmission-entry:hover .transmission-arrow {
    transform: translateX(6px);
    color: #C9A96E;
}

/* ============================================
   SECTION 5: SIGNAL (CONTACT)
   ============================================ */
.section-signal {
    background: #080E1A;
}

.signal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.signal-rule {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 300px;
}

.signal-rule .rule-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #4A5568, #7B92B8, #4A5568);
}

.signal-email {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 32px;
    font-weight: 400;
    color: #E8ECF1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.signal-email:hover {
    color: #C9A96E;
}

.signal-badges {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.badge-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0D1321, #1B2340);
    border: 1px solid #2A3454;
    border-radius: 4px;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.badge-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 12px rgba(201, 169, 110, 0.3);
    border-color: #C9A96E;
}

.badge-link:hover svg {
    stroke: #C9A96E;
}

/* ============================================
   DIAMOND SVG ELEMENTS
   ============================================ */
.diamond-left,
.diamond-right {
    flex-shrink: 0;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
        scroll-snap-type: none;
    }

    .scroll-container {
        scroll-snap-type: none;
    }

    .portfolio-tile:hover {
        transform: none;
    }

    .nav-indicator:hover .nav-dot {
        transform: none;
    }

    .nav-indicator.active .nav-dot {
        animation: none;
    }

    .tile-content::before {
        animation: none;
    }

    .transmission-entry:hover .transmission-arrow {
        transform: none;
    }

    .badge-link:hover {
        transform: none;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    html {
        scroll-snap-type: y proximity;
    }

    .scroll-container {
        scroll-snap-type: y proximity;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tile-2x2 {
        grid-column: span 2;
        grid-row: span 1;
        min-height: 240px;
    }

    .tile-2x1 {
        grid-column: span 2;
    }

    .section-heading {
        font-size: 42px;
    }

    .hero-title {
        font-size: 56px;
    }
}

@media (max-width: 768px) {
    .sidebar-nav {
        display: none;
    }

    .section {
        padding: 40px 24px;
    }

    .section-command {
        padding-left: 24px;
    }

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

    .tile-2x2 {
        grid-column: span 2;
        grid-row: span 1;
        min-height: 200px;
    }

    .tile-2x1 {
        grid-column: span 2;
    }

    .section-heading {
        font-size: 36px;
    }

    .hero-title {
        font-size: 44px;
    }

    .system-readout {
        font-size: 11px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .readout-sep {
        display: none;
    }

    .transmission-entry {
        flex-wrap: wrap;
        gap: 8px;
    }

    .transmission-date {
        width: auto;
    }

    .signal-email {
        font-size: 24px;
    }

    .manifest-content p {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .tile-2x2,
    .tile-2x1 {
        grid-column: span 1;
    }
}
