/* TechToday — dark theme stylesheet */

:root {
    --bg: #121212;
    --bg-elevated: #1e1e1e;
    --border: #2c2c2c;
    --text: #b8c2cc;
    --text-muted: #9e9e9e;
    --text-faint: #757575;
    --accent: #90caf9;
    --bg-elevated-2: #2a2a2a;
}

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

html {
    scroll-behavior: smooth;
}

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: 24px;
    height: 24px;
    display: inline-block;
    background: url('logo.svg') no-repeat center / contain;
    flex-shrink: 0;
}

.brand .logo svg {
    display: none;
}

.study-dropdown {
    position: relative;
}

.study-dropdown>summary {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    list-style: none;
    user-select: none;
}

.study-dropdown summary::-webkit-details-marker,
.study-group summary::-webkit-details-marker {
    display: none;
}

.study-dropdown>summary::after {
    content: "\25BE";
    display: inline-block;
    margin-left: 0.4rem;
    color: var(--accent);
    transition: transform 0.15s ease;
}

.study-dropdown[open]>summary::after {
    transform: rotate(180deg);
}

.study-dropdown>summary:hover,
.study-dropdown>summary:focus-visible {
    color: var(--text);
}

.study-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: max-content;
    min-width: 210px;
    max-height: min(60vh, 360px);
    overflow-y: auto;
    padding: 0.4rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.study-dropdown-menu a {
    display: block;
    padding: 0.55rem 0.7rem;
    color: var(--text-muted);
    border-radius: 5px;
    white-space: nowrap;
}

.study-dropdown-menu a:hover,
.study-dropdown-menu a:focus-visible {
    color: var(--text);
    background: #282828;
    text-decoration: none;
}

.study-dropdown-menu [hidden],
[hidden] {
    display: none !important;
}

.study-group+.study-group {
    border-top: 1px solid var(--border);
}

.study-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.7rem;
    color: var(--text);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

.study-group summary::after {
    content: "\25B8";
    margin-left: 1rem;
    color: var(--accent);
    transition: transform 0.15s ease;
}

.study-group[open] summary::after {
    transform: rotate(90deg);
}

.study-group summary:hover,
.study-group summary:focus-visible {
    background: #282828;
}

.study-group-links {
    padding: 0 0.25rem 0.4rem;
}

.study-group-links a {
    padding-left: 1rem;
}

/* Hero */

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

.hero .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}

.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;
}

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

.hub-toggle-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.65rem;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hub-toggle-all-btn:hover {
    background: var(--bg-elevated-2);
    border-color: var(--accent);
    color: var(--accent);
}

/* Sections */

section {
    padding: 0.75rem 0;
}

/* Project / feature cards */

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

.grid:has(> .card:nth-child(2):last-child),
.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid:has(> .card:nth-child(3):last-child),
.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}


.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem 0.9rem 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 1.15rem;
}

.card {
    counter-increment: project-card;
}

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

.card .icon {
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card .icon svg {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

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

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

.card .status {
    display: inline-block;
    width: fit-content;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-top: 0.25rem;
}

.status.live {
    background: rgba(102, 187, 106, 0.15);
    color: #81c784;
}

.status.coming-soon {
    background: rgba(255, 183, 77, 0.15);
    color: #ffb74d;
}

/* Info Link */
.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;
}

.corner-link {
    position: absolute;
    top: 0.6rem;
    right: 0.65rem;
    width: 1rem;
    height: 1rem;
    margin-left: 0;
    z-index: 2;
}

.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;
    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);
}

/* Footer */

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

/* Navigation back link */
.nav-back-link {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav-back-link:hover,
.nav-back-link:focus-visible {
    color: var(--accent);
    text-decoration: none;
}

/* Category Hub Tiles Grid */
.hub-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.65rem;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.hub-tile {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-tile:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.hub-tile.is-collapsed {
    align-self: start;
    gap: 0;
}

.hub-tile.is-collapsed .hub-tile-header {
    border-bottom: none;
    padding-bottom: 0;
}

.hub-tile.is-collapsed .hub-tile-body {
    display: none;
}

.hub-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.hub-tile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    row-gap: 0.3rem;
    flex-wrap: nowrap;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s ease;
}

.hub-tile-header:hover {
    opacity: 0.9;
}

.hub-tile-header:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.hub-tile-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.hub-tile-title .icon {
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hub-tile-title .icon svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.hub-tile-title h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.hub-tile-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(144, 202, 249, 0.12);
    color: var(--accent);
    border: 1px solid rgba(144, 202, 249, 0.25);
    white-space: nowrap;
}

.hub-status,
.hub-tile-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 0.35rem;
}

.hub-status::before,
.hub-tile-status::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hub-status.live,
.hub-tile-status.live {
    background: rgba(102, 187, 106, 0.12);
    color: #81c784;
    border: 1px solid rgba(102, 187, 106, 0.3);
}

.hub-status.live::before,
.hub-tile-status.live::before {
    background-color: #66bb6a;
    box-shadow: 0 0 6px rgba(102, 187, 106, 0.7);
    animation: pulse-live 2s infinite ease-in-out;
}

.hub-status.coming-soon,
.hub-status.soon,
.hub-status.wip,
.hub-tile-status.coming-soon,
.hub-tile-status.soon,
.hub-tile-status.wip {
    background: rgba(255, 183, 77, 0.12);
    color: #ffb74d;
    border: 1px solid rgba(255, 183, 77, 0.3);
}

.hub-status.coming-soon::before,
.hub-status.soon::before,
.hub-status.wip::before,
.hub-tile-status.coming-soon::before,
.hub-tile-status.soon::before,
.hub-tile-status.wip::before {
    background-color: #ffa726;
    box-shadow: 0 0 5px rgba(255, 183, 77, 0.6);
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.45;
        transform: scale(0.85);
    }
}

.hub-tile-desc {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin: 0;
}

.hub-bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
    gap: 0.4rem 0.5rem;
    flex: 1;
}

.hub-bullet-list li {
    display: inline-flex;
    align-items: center;
}

.hub-bullet-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    padding: 0.24rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.2;
    text-decoration: none;
    background: rgba(144, 202, 249, 0.08);
    color: var(--text);
    border: 1px solid rgba(144, 202, 249, 0.2);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-bullet-list a::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 6px rgba(144, 202, 249, 0.7);
    flex-shrink: 0;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.hub-bullet-list a:hover {
    background: rgba(144, 202, 249, 0.16);
    border-color: rgba(144, 202, 249, 0.45);
    color: #e2e8f0;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(144, 202, 249, 0.2);
}

.hub-bullet-list a:hover::before {
    background-color: #bbdefb;
    box-shadow: 0 0 8px rgba(144, 202, 249, 0.95);
    transform: scale(1.2);
}

.hub-item-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.hub-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.hub-item:hover {
    background: var(--bg-elevated-2);
    border-color: var(--accent);
    text-decoration: none;
}

.hub-item-icon {
    font-size: 1rem;
    line-height: 1.2;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.js-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f7df1e;
    color: #000000;
    font-weight: 800;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.65em;
    width: 1.45em;
    height: 1.45em;
    border-radius: 3px;
    line-height: 1;
    letter-spacing: -0.5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    user-select: none;
}

.hub-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.hub-item-title {
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
}

.hub-item:hover .hub-item-title {
    color: var(--accent);
}

.hub-item-desc {
    color: var(--text-faint);
    font-size: 0.75rem;
    line-height: 1.4;
}

.hub-item-arrow {
    color: var(--text-faint);
    font-size: 0.875rem;
    margin-left: auto;
    align-self: center;
    transition: transform 0.15s ease, color 0.15s ease;
}

.hub-item:hover .hub-item-arrow {
    color: var(--accent);
    transform: translateX(2px);
}

.hub-cta {
    margin-top: auto;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border);
}

.hub-cta a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
}

.hub-cta a:hover {
    text-decoration: underline;
}

/* Responsive */

@media (max-width: 1100px) {
    .hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {

    .grid,
    .grid-2,
    .grid-3,
    .grid:has(> .card:nth-child(2):last-child),
    .grid:has(> .card:nth-child(3):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {

    .grid,
    .grid-2,
    .grid-3,
    .grid:has(> .card:nth-child(2):last-child),
    .grid:has(> .card:nth-child(3):last-child) {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .container {
        width: 94%;
        padding: 0 0.85rem;
    }

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

    .study-dropdown>summary {
        font-size: 0.75rem;
    }

    .study-dropdown-menu {
        max-width: calc(100vw - 2rem);
    }

    .hero .container {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.1rem;
    }

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

    .grid,
    .grid-2,
    .grid-3,
    .grid:has(> .card:nth-child(2):last-child),
    .grid:has(> .card:nth-child(3):last-child) {
        grid-template-columns: 1fr !important;
    }

    .hub-tile-header {
        flex-wrap: wrap;
    }

    .hub-status,
    .hub-tile-status {
        margin-left: 1.6rem;
    }
}