/* AWS Strands — dark theme stylesheet (shares TechToday design tokens) */

:root {
    --bg: #121212;
    --bg-elevated: #1e1e1e;
    --bg-elevated-2: #2a2a2a;
    --border: #2c2c2c;
    --text: #e0e0e0;
    --text-muted: #9e9e9e;
    --text-faint: #757575;
    --accent: #90caf9;
    --primary: #1565c0;
    --primary-hover: #1976d2;
    --danger: #ef9a9a;
}

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

body {
    font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 90%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header / Nav */

header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
}

.brand .logo {
    width: 28px;
    height: 28px;
}

/* Hero */

.hero {
    padding: 0.65rem 0;
    text-align: left;
}

.hero .container {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.75rem;
}

.hero h1 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1.3;
}

.hero .subtitle {
    color: var(--text-faint);
    font-size: 0.8125rem;
    margin: 0;
    white-space: nowrap;
}

.hero .subtitle::before {
    content: "\2022";
    margin-right: 0.75rem;
    color: var(--border);
}

/* Sections */

section {
    padding: 0.75rem 0;
}

/* Cards grid */

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    counter-reset: project-card;
}

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    counter-increment: project-card;
}

/* A card that spans both columns. */
.card-wide {
    grid-column: 1 / -1;
}

.card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.card h2::before {
    content: counter(project-card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 1px solid #4caf50;
    border-radius: 50%;
    color: #ff9800;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
}

.card p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.card p code {
    background: var(--bg-elevated-2);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--accent);
}

/* Info icon — links to the "how this works" explainer page for a card */

.info-link {
    position: relative;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1rem;
    line-height: 1;
    color: #4caf50;
}

.info-link:hover {
    color: #ff9800;
    text-decoration: none;
}

.info-link::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 135%;
    right: 0;
    white-space: nowrap;
    background: var(--bg-elevated-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.6875rem;
    font-weight: 400;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    z-index: 20;
}

.info-link:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Form controls */

input[type="text"] {
    width: 100%;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #424242;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text);
    background: transparent;
    outline: none;
}

input[type="text"]::placeholder {
    color: #616161;
}

input[type="text"]:focus {
    border-bottom-color: var(--accent);
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

button:hover {
    background: var(--primary-hover);
}

button:active {
    box-shadow: none;
}

button:disabled {
    background: #424242;
    color: var(--text-faint);
    cursor: not-allowed;
    box-shadow: none;
}

/* Results */

.result {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #bdbdbd;
    background: var(--bg-elevated-2);
    border-left: 3px solid var(--primary);
    padding: 10px 12px;
    white-space: pre-wrap;
    display: none;
}

.result.visible {
    display: block;
}

.error {
    color: var(--danger);
}

.validation {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: -6px;
}

.validation:empty {
    display: none;
}

/* Spinner */

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */

footer {
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    text-align: center;
    color: var(--text-faint);
    font-size: 0.8125rem;
}

/* Responsive */

@media (max-width: 720px) {
    .hero .container {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.1rem;
    }

    .hero .subtitle {
        white-space: normal;
    }

    .hero .subtitle::before {
        content: none;
    }

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