/* --- VARIABLES & RESET --- */
:root {
    --bg-color: #111111;
    --text-color: #EAEAEA;
    --accent-color: #39FF14; /* Neon Green */
    --card-bg-color: #1A1A1A;
    --border-color: #333333;
    --font-heading: 'Clash Display', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- GENERAL TYPOGRAPHY & LAYOUT --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: white;
}

.hero-headline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1em; /* Optional: adds a small gap between the lines */
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: 1.5rem; color: var(--accent-color); }
h4 { font-size: 1.25rem; }

section {
    padding: 6rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

p {
    max-width: 65ch;
    margin: 1rem auto;
    color: var(--text-color);
    opacity: 0.9;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* --- HERO & FINAL CTA SECTION --- */
.hero-section, .final-cta-section {
    position: relative;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.creation-credit {
    position: absolute;
    top: 2rem;
    left: 5%;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.4;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.creation-credit a {
    color: inherit; /* Inherit the default text color */
}

.final-cta-section {
    max-width: none; /* Allow this section to be full-width */
    padding: 0; /* Reset padding, will be applied to inner wrapper */
    min-height: auto;
    background: linear-gradient(0deg, rgba(26,26,26,1) 0%, rgba(17,17,17,1) 100%);
}

.final-cta-wrapper {
    /* Constrain the content to the max-width and center it */
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 5% 3rem;
    text-align: center;
}

.email-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.email-display {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    padding: 1rem 2rem;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-color);
    border-radius: 8px;
    color: white;
}

.copy-button {
    background-color: var(--accent-color);
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.copy-button:hover {
    transform: scale(1.05);
}

.copy-button:active {
    transform: scale(0.98);
}

.copy-button .copy-icon {
    stroke: #000;
}

/* --- HERO ANIMATION --- */
.adjective-container {
    /* Set height to match the line-height of the spans inside to prevent clipping */
    height: 1.2em;
    overflow: hidden;
}

.adjective-slider {
    animation: slide-adjectives 15s infinite cubic-bezier(0.23, 1, 0.32, 1);
}

.adjective-slider span {
    display: block;
    color: var(--accent-color);
    text-align: center;
    line-height: 1.2; /* Should match h1 line-height */
}

@keyframes slide-adjectives {
    0%, 15%   { transform: translateY(calc(0 * -1.2em)); } /* jerk */
    17%, 32%  { transform: translateY(calc(1 * -1.2em)); } /* troll */
    34%, 49%  { transform: translateY(calc(2 * -1.2em)); } /* spammer */
    51%, 66%  { transform: translateY(calc(3 * -1.2em)); } /* micromanager */
    68%, 83%  { transform: translateY(calc(4 * -1.2em)); } /* know-it-all */
    85%, 98%  { transform: translateY(calc(5 * -1.2em)); } /* asshole */
    100%      { transform: translateY(calc(6 * -1.2em)); } /* jerk */
}

/* --- HOW IT WORKS SECTION --- */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    text-align: left;
}

.step {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.step-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 1rem;
}

.step p {
    margin: 0.5rem 0 0 0;
    max-width: 100%;
}

/* --- HALL OF SHAME SECTION --- */
.hall-of-shame-section {
    background-color: #000;
    border-radius: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3rem;
}

.section-header h2 {
    text-align: left;
}

.takedown-counter {
    text-align: right;
}

.counter-label {
    font-family: var(--font-body);
    text-transform: uppercase;
    font-size: 0.9rem;
    opacity: 0.6;
    letter-spacing: 0.05em;
}

.counter-number {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--accent-color);
    line-height: 1;
}

.case-files-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    text-align: left;
}

.case-file {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease;
}

.case-file-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.case-file:hover {
    border-color: var(--accent-color);
}

.share-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-color);
    opacity: 0.4;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.share-button:hover {
    opacity: 1;
    color: var(--accent-color);
}

.email-snippet {
    border-left: 3px solid var(--accent-color);
    padding-left: 1rem;
    font-family: var(--font-mono);
}

.email-snippet p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    max-width: 100%;
}

.email-from {
    opacity: 0.7;
}

/* --- THREAT ANALYSIS SECTION --- */
.threat-analysis-section {
    margin-top: 6rem; /* Add spacing from the section above */
    background-color: var(--card-bg-color);
    border-radius: 24px;
    padding: 3rem 5%; /* Make section more compact */
}

.analysis-container {
    margin-top: 1.5rem; /* Adjust spacing */
}

#email-input {
    width: 100%;
    min-height: 100px; /* Make textarea more compact */
    padding: 0.75rem; /* Reduce padding */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #000;
    color: var(--text-color);
    font-family: var(--font-mono);
    resize: vertical;
}

.analysis-result {
    margin-top: 1.5rem; /* Adjust spacing */
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-mono);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#highlighted-text {
    margin: 0;
    white-space: pre-wrap; /* Preserve formatting from textarea */
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}

#threat-level-container {
    width: 100%;
}

#threat-level {
    text-align: left;
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.threat-meter-bar {
    width: 100%;
    height: 12px;
    background-color: #000;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

#threat-meter-fill {
    width: 0;
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 5px;
    transition: width 0.5s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.5s ease;
}

.highlight {
    color: var(--accent-color);
}

.email-reply strong {
    color: var(--accent-color);
}

#threat-meter-fill.level-low { background-color: #2a9d8f; } /* Teal */
#threat-meter-fill.level-elevated { background-color: #e9c46a; } /* Yellow */
#threat-meter-fill.level-high { background-color: #f4a261; } /* Orange */
#threat-meter-fill.level-critical { background-color: #e76f51; } /* Red */

.threat-analysis-section h2,
.threat-analysis-section p {
    margin-bottom: 0.75rem; /* Reduce default margins for compactness */
}

/* --- RULES SECTION --- */
.rules-section ul {
    list-style: none;
    margin-top: 3rem;
    display: inline-block;
    text-align: left;
    max-width: 70ch;
}

.rules-section li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.rules-section li:last-child {
    border-bottom: none;
}

.rules-section li strong {
    color: var(--accent-color);
    display: block;
    margin-bottom: 0.25rem;
}

.rules-section .subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    opacity: 0.6;
}

.disclaimer {
    margin-top: 3rem;
    font-size: 0.9rem;
    opacity: 0.6;
}

/* --- SHAREABLE IMAGE STYLES --- */
/* This wrapper is used off-screen to generate the shareable image */
.share-image-wrapper {
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 640px; /* A good width for social media sharing */
    background-color: var(--bg-color);
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border: 1px solid var(--border-color);
}

.share-image-wrapper .case-file {
    margin: 0; /* Remove any inherited margins */
}

.share-image-branding {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-family: var(--font-mono);
    color: var(--text-color);
    font-size: 14px;
}

.share-image-branding .tagline { opacity: 0.6; }
.share-image-branding .url { color: var(--accent-color); font-weight: 500; }

/* --- FOOTER --- */
footer {
    margin-top: 6rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.6;
}

.footer-credit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5ch;
}

.verb-container {
    height: 1.2em; /* Match line-height of the text */
    overflow: hidden;
}

.verb-slider {
    animation: slide-verbs 15s infinite cubic-bezier(0.23, 1, 0.32, 1);
}

.verb-slider span {
    display: block;
    text-align: right;
    color: inherit;
    line-height: 1.2;
}

@keyframes slide-verbs {
    0%, 10%   { transform: translateY(calc(0 * -1.2em)); }      /* Built */
    10%, 20% { transform: translateY(calc(1 * -1.2em)); }    /* Created */
    20%, 30% { transform: translateY(calc(2 * -1.2em)); }    /* Forged */
    30%, 40% { transform: translateY(calc(3 * -1.2em)); }    /* Engineered */
    40%, 50% { transform: translateY(calc(4 * -1.2em)); }    /* Crafted */
    50%, 60% { transform: translateY(calc(5 * -1.2em)); }    /* Designed */
    60%, 70% { transform: translateY(calc(6 * -1.2em)); }    /* Coded */
    70%, 80% { transform: translateY(calc(7 * -1.2em)); }    /* Assembled */
    80%, 90% { transform: translateY(calc(8 * -1.2em)); }    /* Imagined */
    90%, 100% { transform: translateY(calc(9 * -1.2em)); }   /* Launched */
}

/* --- RESPONSIVENESS --- */
@media (max-width: 768px) {
    section {
        padding: 4rem 5%;
    }

    .creation-credit {
        position: static; /* Return to normal document flow */
        margin-bottom: 2rem; /* Add space between it and the headline */
    }

    .section-header {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .takedown-counter {
        text-align: center;
    }

    .final-cta-wrapper {
        padding: 4rem 5%; /* Adjust padding for mobile */
    }
}

.creation-credit a:hover {
    color: var(--accent-color);
}