/*
Theme Name: BrokenTooth
Author: Sam
Description: Portfolio theme for brokentooth.io
Version: 0.3.0
*/

/* ============================================
   BROKENTOOTH — Prototype B Styles
   Desktop-first with mobile breakpoint
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

/* --- Color Tokens --- */
:root {
    --bt-bg: #000000;
    /* true black to match silo */
    --bt-surface: #0a0a0a;
    /* barely lighter for depth */
    --bt-surface-alt: #111111;
    /* panels */
    --bt-text: #f2f2ef;
    /* warm off-white */
    --bt-accent: #8a0000;
    /* worn hazard-paint red */
    --bt-accent-glow: rgba(138, 0, 0, 0.4);
    --bt-accent-faded: #5a0000;
    --bt-line: #1a1a1a;
    /* dividers */

    --bt-sidebar-width: 48px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    line-height: 1.7;
    color: var(--bt-text);
    background: var(--bt-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ============================================
   FIXED LEFT SIDEBAR (Vital Mechanics)
   ============================================ */
.bt-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--bt-sidebar-width);
    height: 100vh;
    background: var(--bt-bg);
    border-right: 1px solid var(--bt-line);
    z-index: 1000;
    /* Increased z-index */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.bt-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.bt-sidebar__link {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bt-text);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: all 200ms ease;
    position: relative;
    display: block;
    /* Ensure block model applies */
}

.bt-sidebar__link:hover {
    color: var(--bt-accent);
    text-shadow: 0 0 20px var(--bt-accent-glow);
}

.bt-sidebar__link::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 2px;
    height: 0;
    background: var(--bt-accent);
    transition: height 200ms ease;
}

.bt-sidebar__link:hover::before {
    height: 100%;
}

/* --- Layout Container (offset for sidebar) --- */
.bt-wrapper {
    min-height: 100vh;
    margin-left: var(--bt-sidebar-width);
    position: relative;
    z-index: 10;
}

/* ============================================
   HERO SECTION — DESKTOP TRIPTYCH
   BROKEN — [silo] — TOOTH
   ============================================ */
.bt-hero {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    gap: 0;
    animation: fadeIn 300ms ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* --- Word blocks --- */
.bt-hero__word {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bt-hero__word span {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #ffffff;
    writing-mode: horizontal-tb;
}

/* Desktop: words flank the silo */
.bt-hero__word--left {
    padding-right: 2rem;
}

.bt-hero__word--right {
    padding-left: 2rem;
}

/* --- Silo Image with Blend Mask --- */
.bt-hero__silo {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 50%;
}

.bt-hero__silo img {
    max-width: 100%;
    max-height: 85vh;
    height: auto;
    width: auto;
    object-fit: contain;

    /* Radial gradient mask to fade edges into background */
    mask-image: radial-gradient(ellipse 80% 90% at center,
            black 60%,
            transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 90% at center,
            black 60%,
            transparent 100%);
}

/* ============================================
   MOBILE: Split-screen layout
   ============================================ */
@media (max-width: 768px) {

    /* Hide sidebar on mobile */
    .bt-sidebar {
        display: none;
    }

    .bt-wrapper {
        margin-left: 0;
    }

    .bt-hero {
        flex-direction: row;
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
        gap: 0;
        position: relative;
    }

    /* Left half: stacked text */
    .bt-hero__word {
        position: absolute;
        left: 0;
        width: 50%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 1rem;
    }

    .bt-hero__word--left {
        top: 35%;
        padding-right: 0;
    }

    .bt-hero__word--right {
        top: 50%;
        padding-left: 0;
    }

    .bt-hero__word span {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
        letter-spacing: 0.15em;
    }

    /* Right half: full-height silo */
    .bt-hero__silo {
        position: absolute;
        right: 0;
        top: 0;
        width: 50%;
        height: 100vh;
        max-width: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }

    .bt-hero__silo img {
        max-height: 90vh;
        max-width: 100%;
    }
}

/* ============================================
   CONTENT AREA
   ============================================ */
.bt-content {
    padding: 3rem 2rem;
    background: var(--bt-bg);
}

.bt-content__block {
    background: var(--bt-surface-alt);
    border: 1px solid var(--bt-line);
    border-radius: 2px;
    padding: 2rem;
    max-width: 800px;
}

.bt-content__block p {
    color: var(--bt-text);
    opacity: 0.7;
    font-size: 0.9rem;
    line-height: 1.8;
}

/* ============================================
   UTILITY & EFFECTS
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Grain Overlay (Moved to bottom to prevent syntax blocking) --- */
.bt-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.07;
    /* Simplified data URI for safety */
    background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}