/* Breakpoints do projeto (media queries nao aceitam var(), entao os valores
   sao escritos literalmente — esta e a convencao a seguir):
     900px -> tablet: header empilha, densidade reduz
     600px -> celular: layout de uma mao                                   */

:root {
    --bg: #26282b;
    --bg-glow: #38415c;
    --surface: #303338;
    --surface-hover: #3a3d42;
    --text: #ececec;
    --text-soft: #9da3ae;
    --border: #43474d;
    --accent: #5b9cff;
    --accent-hover: #095ae7;
}

/*Layout*/
.container {
    width: min(1100px, 92%);
    margin: auto;
    padding: clamp(48px, 9vw, 70px) 0 clamp(32px, 6vw, 50px);
    display: flex;
    flex-direction: column;
    flex: 1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: clamp(32px, 8vw, 70px);
}


.light {
    --bg: #f3f4f6;
    --bg-glow: #dbe3f5;
    --surface: #ffffff;
    --surface-hover: #f7f7f7;
    --text: #202124;
    --text-soft: #5f6368;
    --border: #dddddd;
}

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

body {
    font-family: Inter, sans-serif;
    background: radial-gradient(circle at top, var(--bg-glow) 0%, var(--bg) 65%);
    color: var(--text);
    transition: .35s;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

footer {
    margin-top: auto;
    padding-top: 60px;
}

.search-bar {
  display: flex;
  gap: 12px;
  max-width: 840px;
  margin: 0 auto 24px;
}

.search-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.empty-state {
  text-align: center;
  color: var(--text-soft);
  margin-top: 12px;
}

.details-panel {
  max-width: 840px;
  margin: 0 auto 24px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(91,156,255,0.08));
  color: var(--text);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, opacity 0.25s ease;
  font-size: 0.95rem;
  line-height: 1.6;
}

.details-panel:hover {
  transform: translateY(-2px);
}

.details-panel h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.details-panel p {
  margin-bottom: 8px;
}

header h1 {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
    font-weight: 600;
    letter-spacing: .5px;
}

header p {
    color: var(--text-soft);
    margin-top: 8px;
    font-size: .95rem;
}

.subtitle {
    color: var(--accent);
    font-size: .95rem;
    letter-spacing: .4px;
    margin-top: 4px;
}

.header-home-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 10px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    max-height: 40px;
    opacity: 1;
    overflow: hidden;
    transform: translateY(0);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease,
        max-height 0.35s ease, opacity 0.25s ease, margin-top 0.35s ease,
        padding 0.35s ease, border-width 0.35s ease, transform 0.35s ease;
}

.header-home-button:hover,
.header-home-button:focus-visible {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(91, 156, 255, 0.12);
    outline: none;
}

.header-home-button.is-collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

#site-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 840px;
    margin: 40px auto 0;
}

.menu-btn {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-soft);
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
    transition: .2s;
}

.menu-btn:hover,
.menu-btn:focus-visible {
    color: var(--text);
    border-color: var(--accent);
    outline: none;
}

.about-btn {
    color: var(--accent);
    font-size: .95rem;
    letter-spacing: .4px;
    margin-top: 4px;
    border:none;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: .2s;
}
.about-btn:hover,
.about-btn:focus-visible {
    color: var(--accent-hover);
    outline: none;
}

.page-tag {
    max-width: 840px;
    margin: 0 auto 16px;
    color: var(--text-soft);
    font-size: .75rem;
    letter-spacing: 1.5px;
}

.top-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    font-size: 12px;
    color: var(--text-soft);
    opacity: .85;
}

.top-right-row {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 16px;
    font-size: 12px;
    color: var(--text-soft);
    opacity: .85;
}

.theme-toggle {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-soft);
    opacity: .6;
    cursor: pointer;
    transition: .25s;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    opacity: 1;
    color: var(--text);
    border-color: var(--accent);
    outline: none;
}

.theme-toggle svg {
    position: absolute;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    transition: opacity .2s, transform .2s;
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: scale(.5);
}

body.light .theme-toggle .icon-moon {
    opacity: 0;
    transform: scale(.5);
}

body.light .theme-toggle .icon-sun {
    opacity: 1;
    transform: scale(1);
}

.clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    text-align: right;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(130px, 40vw, 160px), 1fr));
    gap: clamp(12px, 3vw, 18px);
    max-width: 840px;
    margin: 0 auto;
}

/* Grid principal: o card tem tamanho fixo e o flex distribui e quebra
   sozinho — 4, 3, 2 ou 1 por linha conforme a largura disponivel.
   (Herda gap, max-width e margin de .grid; so o modo de layout muda.) */
#grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    flex: 0 0 auto;
    width: 160px;
    height: 120px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform .28s ease, box-shadow .28s ease, background .28s ease, border-color .28s ease;
    text-decoration: none;
    font: inherit;
    color: inherit;
}

.card:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.18);
}

.hub-card {
    height: auto;
    min-height: 120px;
    width: 100%;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    transition: transform .28s ease, box-shadow .28s ease, background .28s ease, border-color .28s ease;
    font: inherit;
    color: inherit;
    position: relative;
}

.hub-card-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 12px;
    background: var(--surface-hover);
    border-bottom: 1px solid var(--border);
}

.hub-card-title {
    font-size: .78rem;
    font-weight: 500;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hub-card-badge {
    flex-shrink: 0;
    font-size: .72rem;
    color: var(--accent);
}

.hub-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    text-align: center;
}

.hub-card-description {
    margin: 0;
    font-size: .72rem;
    line-height: 1.35;
    opacity: .7;
}

.hub-card:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.18);
}

.hub-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.hub-card.featured .hub-card-bar {
    background: linear-gradient(135deg, rgba(91, 156, 255, 0.22), rgba(91, 156, 255, 0.06));
}

.icon {
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.icon svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.hub-card .icon {
    width: 22px;
    height: 22px;
    margin-bottom: 0;
    font-size: .85rem;
}

.hub-card .icon svg {
    width: 18px;
    height: 18px;
}

.title {
    font-size: .92rem;
    text-align: center;
}


.details-panel a {
    display: inline-block;
    margin-top: 6px;
    color: var(--accent);
    text-decoration: none;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

footer h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 500;
}

footer p {
    max-width: 750px;
    color: var(--text-soft);
    line-height: 1.6;
    font-size: .92rem;
}

.about {
    font-size: .88rem;
    color: var(--text-soft);
    letter-spacing: .4px;
}

.social {
    display: flex;
    gap: 14px;
}

.social a,
.social button {
    color: var(--text-soft);
    font-size: .78rem;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    transition: .25s;
    display: inline-flex;
    align-items: center;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.social a:hover,
.social button:hover {
    color: var(--accent);
}

.social a i {
    display: inline-flex;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    margin-left: 6px;
}

.copyright {
    text-align: center;
    font-size: .75rem;
    color: var(--text-soft);
    opacity: .65;
    letter-spacing: .5px;
}
.section {
    margin-top: 32px;
}

[hidden] {
    display: none !important;
}
@media (max-width: 900px) {
    header {
        flex-direction: column;
        gap: 20px;
    }

    .top-right {
        width: 100%;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    /* No celular os cards ficam em coluna: um item por linha. */
    .grid {
        grid-template-columns: 1fr;
    }

    /* Alvo de toque confortavel (>= 44px) para o botao de tema. */
    .theme-toggle {
        width: 44px;
        height: 44px;
    }

    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

