/* scriptgrapher.com — Design System */

/* ============ RESET & BASE ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0A0A0F;
    color: #A0A0B0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(255, 107, 107, 0.3);
    color: #FFFFFF;
}

/* ============ HERO: The Letter ============ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0A0A0F;
}

.bg-letter {
    position: absolute;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 70vw;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.015);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    user-select: none;
    animation: bgLetterDrift 20s ease-in-out infinite;
}

@keyframes bgLetterDrift {
    0%, 100% { opacity: 0.015; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.03; transform: translate(-50%, -50%) scale(1.05); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(110, 193, 228, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 193, 228, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.morph-letter {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(10rem, 22vw, 28rem);
    color: #FFFFFF;
    line-height: 0.85;
    margin-bottom: 0.5rem;
    animation: morphWeight 6s ease-in-out infinite;
    text-shadow: 0 0 80px rgba(110, 193, 228, 0.15);
}

@keyframes morphWeight {
    0%, 100% {
        font-weight: 300;
        letter-spacing: -0.05em;
        text-shadow: 0 0 80px rgba(110, 193, 228, 0.1);
    }
    50% {
        font-weight: 700;
        letter-spacing: 0.1em;
        text-shadow: 0 0 120px rgba(255, 107, 107, 0.15);
    }
}

.headline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: #FFFFFF;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}

.hero-sub {
    font-size: 1.05rem;
    color: #A0A0B0;
    margin-bottom: 2.5rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.cta-btn {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: #0A0A0F;
    background: #FF6B6B;
    padding: 0.85rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.25);
    transition: transform 0.25s ease, box-shadow 0.3s ease, background 0.3s ease;
    letter-spacing: 0.02em;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px rgba(255, 107, 107, 0.4);
    background: #ff7f7f;
}

.scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
}

.scroll-hint-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #A0A0B0;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-hint-line {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, #A0A0B0, transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.3); }
}

/* ============ SHARED SECTION STYLES ============ */
.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.section-intro {
    font-size: 0.95rem;
    color: #A0A0B0;
    text-align: center;
    max-width: 520px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

/* ============ TYPE SPECIMENS: The Gallery ============ */
.specimens {
    padding: 5rem 2rem;
    overflow: hidden;
}

.specimen-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.25rem;
    padding: 1rem 0 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #1E1E28 #0A0A0F;
}

.specimen-scroll::-webkit-scrollbar {
    height: 6px;
}

.specimen-scroll::-webkit-scrollbar-track {
    background: #0A0A0F;
}

.specimen-scroll::-webkit-scrollbar-thumb {
    background: #1E1E28;
    border-radius: 3px;
}

.specimen-card {
    background: #141418;
    border: 1px solid #1E1E28;
    border-radius: 10px;
    aspect-ratio: 3 / 4;
    min-width: 260px;
    max-width: 300px;
    padding: 2rem 1.75rem;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.specimen-card:hover {
    border-color: #FF6B6B;
    transform: translateY(-4px);
}

.specimen-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: rgba(110, 193, 228, 0.4);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.specimen-sample {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    color: #FFFFFF;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.specimen-sample.grotesk {
    font-weight: 400;
    letter-spacing: 0;
}

.specimen-sample.condensed {
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 1.5rem;
}

.specimen-sample.italic {
    font-style: italic;
    font-weight: 300;
}

.specimen-sample.ultra {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.7rem;
}

.specimen-sample.wide {
    font-weight: 300;
    letter-spacing: 0.12em;
    font-size: 1.3rem;
}

.specimen-sample.mono {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 1.3rem;
}

.specimen-meta {
    margin-bottom: 1rem;
}

.specimen-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #6EC1E4;
    margin-bottom: 0.25rem;
}

.specimen-detail {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #A0A0B0;
}

.customize-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #FF6B6B;
    text-decoration: none;
    border: 1px solid rgba(255, 107, 107, 0.4);
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    align-self: flex-start;
}

.customize-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: #FF6B6B;
    color: #FFFFFF;
}

.customize-btn .arrow {
    transition: transform 0.25s ease;
}

.customize-btn:hover .arrow {
    transform: translateX(3px);
}

/* ============ PARAMETERS: The Controls ============ */
.parameters {
    max-width: 800px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.param-panel {
    background: #141418;
    border: 1px solid #1E1E28;
    border-radius: 14px;
    padding: 2.5rem;
    display: flex;
    gap: 3rem;
    align-items: center;
    flex-wrap: wrap;
}

.param-preview-area {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 200px;
}

.param-preview {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10rem;
    color: #FFFFFF;
    line-height: 1;
    position: relative;
    z-index: 1;
    transition: font-weight 0.15s ease, font-style 0.15s ease;
}

.param-preview-bg {
    position: absolute;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10rem;
    color: rgba(110, 193, 228, 0.04);
    line-height: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
    pointer-events: none;
    font-weight: 700;
}

.param-controls {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.param-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.param-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #A0A0B0;
    width: 110px;
    flex-shrink: 0;
}

.param-slider {
    -webkit-appearance: none;
    appearance: none;
    background: #1E1E28;
    height: 4px;
    border-radius: 2px;
    flex: 1;
    outline: none;
    position: relative;
}

.param-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6EC1E4;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(110, 193, 228, 0.3);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.param-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 20px rgba(110, 193, 228, 0.5);
    transform: scale(1.15);
}

.param-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6EC1E4;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(110, 193, 228, 0.3);
}

.param-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #6EC1E4;
    width: 55px;
    text-align: right;
    flex-shrink: 0;
}

.letter-picker {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.letter-option {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #A0A0B0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #1E1E28;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.letter-option:hover {
    border-color: #6EC1E4;
    color: #FFFFFF;
}

.letter-option.active {
    border-color: #6EC1E4;
    color: #FFFFFF;
    background: rgba(110, 193, 228, 0.1);
}

/* ============ CODE EXAMPLES: The Scripts ============ */
.code-examples {
    max-width: 960px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.code-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.code-panel {
    background: #141418;
    border: 1px solid #1E1E28;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.code-panel:hover {
    border-color: rgba(110, 193, 228, 0.3);
    transform: translateY(-2px);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: rgba(10, 10, 15, 0.5);
    border-bottom: 1px solid #1E1E28;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background: #FF6B6B; }
.dot.yellow { background: #FFD93D; }
.dot.green { background: #6EC1E4; }

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #A0A0B0;
}

.code-block {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #A0A0B0;
    line-height: 1.8;
    white-space: pre;
    overflow-x: auto;
    padding: 1.25rem 1.25rem 1.25rem 3.5rem;
}

.code-line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    padding-top: calc(0.85rem + 1px + 0.85rem + 1.25rem);
    padding-left: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    line-height: 1.8;
    color: rgba(160, 160, 176, 0.25);
    pointer-events: none;
    user-select: none;
}

.kw { color: #FF6B6B; }
.fn { color: #FFFFFF; }
.str { color: #FFD93D; }
.val { color: #6EC1E4; }
.cm { color: #555; font-style: italic; }

/* ============ WORKFLOW: Process ============ */
.workflow {
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.workflow-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
}

.workflow-step {
    flex: 1;
    text-align: center;
    padding: 1.5rem;
    position: relative;
}

.step-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: rgba(110, 193, 228, 0.4);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.step-icon {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
}

.step-icon svg {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.workflow-step:hover .step-icon svg {
    opacity: 1;
}

.step-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #FFFFFF;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.step-desc {
    font-size: 0.85rem;
    color: #A0A0B0;
    line-height: 1.65;
    max-width: 220px;
    margin: 0 auto;
}

.workflow-connector {
    width: 40px;
    height: 1px;
    background: linear-gradient(to right, #1E1E28, rgba(110, 193, 228, 0.2), #1E1E28);
    flex-shrink: 0;
    margin-top: 5.5rem;
}

/* ============ FOOTER: The Output ============ */
.footer {
    max-width: 700px;
    margin: 0 auto;
    padding: 4rem 2rem 3rem;
    text-align: center;
}

.footer-glyph {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: #FFFFFF;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    opacity: 0.5;
}

.footer-tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: #FFFFFF;
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.flink {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #6EC1E4;
    text-decoration: none;
    transition: color 0.25s ease;
    position: relative;
}

.flink:hover {
    color: #FFFFFF;
}

.flink::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: #6EC1E4;
    transition: width 0.25s ease;
}

.flink:hover::after {
    width: 100%;
}

.footer-divider {
    width: 40px;
    height: 1px;
    background: #1E1E28;
    margin: 0 auto 1.5rem;
}

.footer-copy {
    font-size: 0.7rem;
    color: rgba(160, 160, 176, 0.5);
}

/* ============ FADE-IN ANIMATIONS ============ */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .code-grid {
        grid-template-columns: 1fr;
    }

    .param-panel {
        flex-direction: column;
        gap: 2rem;
    }

    .param-preview-area {
        width: 100%;
        height: auto;
    }

    .param-preview {
        font-size: 8rem;
    }

    .param-preview-bg {
        font-size: 8rem;
    }

    .workflow-steps {
        flex-direction: column;
        align-items: center;
    }

    .workflow-connector {
        width: 1px;
        height: 30px;
        background: linear-gradient(to bottom, #1E1E28, rgba(110, 193, 228, 0.2), #1E1E28);
        margin-top: 0;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 1.25rem;
    }

    .specimen-card {
        min-width: 220px;
    }
}

@media (max-width: 480px) {
    .morph-letter {
        font-size: 8rem;
    }

    .param-preview {
        font-size: 6rem;
    }

    .param-preview-bg {
        font-size: 6rem;
    }

    .param-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .param-label {
        width: 100%;
    }

    .letter-picker {
        flex-wrap: wrap;
    }
}
