/* ========================
   Reset & Variables
   ======================== */

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

:root {
    --gold: #fbaa1d;
    --gold-light: #fccd49;
    --teal: #1f5b70;
    --teal-dark: #174a5c;
    --beige: #e3d7c9;
    --brown: #b29376;
    --bg: #f6f1ec;
    --white: #ffffff;
    --text: #1f2d33;
    --text-secondary: #5c6b72;
    --border: #d9cfc3;
    --shadow: 0 1px 3px rgba(31, 91, 112, 0.06);
    --shadow-lg: 0 6px 24px rgba(31, 91, 112, 0.1);
    --radius: 10px;
    --font-heading: "Oswald", sans-serif;
    --font-body: "Roboto", sans-serif;
    /* Pan-Latin/Greek/Cyrillic for hero letter grid (Oswald is Latin-only). */
    --font-letter-grid: "Noto Sans", sans-serif;
}

/* ========================
   Base
   ======================== */

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

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ========================
   Header (shared)
   ======================== */

header {
    background-color: #fbaa1d;
    position: relative;
    z-index: 100;
    box-shadow: none;
    overflow: hidden;
}

nav {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 1rem 3rem;
    display: flex;
    justify-content: flex-end;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0.25rem;
}

.nav-links > li > a,
.dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    letter-spacing: 0.01em;
}

.nav-links > li > a:hover,
.dropdown-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Dropdown */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: var(--white);
    list-style: none;
    min-width: 210px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 200;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text);
    transition: background-color 0.15s, color 0.15s;
}

.dropdown-menu a:hover {
    background-color: var(--bg);
    color: var(--teal);
}

/* ========================
   Announcement Bar
   ======================== */

.announcement-bar {
    position: relative;
    overflow: hidden;
    padding: 0.75rem 2rem;
    text-align: center;
    z-index: 99;
}

.announcement-bar p {
    position: relative;
    z-index: 1;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.01em;
}

.announcement-bar a {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.announcement-bar a:hover {
    color: var(--teal);
}

.noise-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========================
   Letter Grid Background
   ======================== */

.letter-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.letter-grid-inner {
    position: absolute;
    left: 0;
    top: 0;
    width: 200%;
    height: 200%;
    animation: gridPan 25s linear infinite;
}

.letter-grid-inner span {
    position: absolute;
    font-family: var(--font-letter-grid);
    font-weight: 500;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.25);
    transform: rotate(-15deg);
}

@keyframes gridPan {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-50%, -50%);
    }
}

/* ========================
   Header Hero (homepage)
   ======================== */

.header-hero {
    padding-bottom: 2rem;
}

.header-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 3rem 3rem;
    text-align: center;
}

.header-content .logo-img {
    height: 220px;
    width: auto;
    flex-shrink: 0;
    margin-bottom: 2rem;
    transform: scale(1.4);
}

.header-text {
    max-width: 800px;
}

.header-content h1 {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 2.5rem;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
}

.header-content p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    max-width: 560px;
    margin: 0 auto;
}

/* ========================
   Header (article pages)
   ======================== */

.header-simple {
    padding-bottom: 0;
}

.header-simple nav {
    justify-content: space-between;
}

.header-simple .logo-link {
    display: flex;
    align-items: center;
}

.header-simple .logo-link .logo-img {
    height: 60px;
    width: auto;
}

/* ========================
   Layout
   ======================== */

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    min-height: calc(100vh - 200px - 64px);
}

/* ========================
   Homepage — Explainer
   ======================== */

.explainer {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 2px solid var(--beige);
}

.explainer h2 {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.4rem;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.explainer h2:first-child {
    margin-top: 0;
}

.explainer p {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.explainer ul {
    margin: 0.75rem 0 1.25rem;
    padding-left: 1.5rem;
}

.explainer li {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.explainer li strong {
    color: var(--text);
    font-weight: 500;
}

.explainer li::marker {
    color: var(--gold);
}

/* ========================
   Homepage — Topic Cards
   ======================== */

.topics-heading {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.3rem;
    color: var(--brown);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.topic-card {
    display: block;
    background-color: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.5rem 1.5rem 1.5rem 1.75rem;
    transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}

.topic-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-left-color: var(--gold-light);
}

.topic-card h2 {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.topic-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1rem;
}

.topic-card .read-more {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gold);
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.topic-card:hover .read-more {
    color: var(--teal);
}

/* ========================
   Article Pages
   ======================== */

.article {
    max-width: 720px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gold);
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--teal);
}

.article h1 {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 2.5rem;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}

.article .subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--beige);
}

.article h2 {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.5rem;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article h3 {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--teal-dark);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article p {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.article ul,
.article ol {
    margin: 1rem 0 1.5rem;
    padding-left: 1.5rem;
}

.article li {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.article li strong {
    color: var(--text);
    font-weight: 500;
}

.article li::marker {
    color: var(--gold);
}

.article code {
    background-color: var(--beige);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--teal-dark);
}

/* ========================
   Footer
   ======================== */

footer {
    background-color: var(--teal);
    text-align: center;
    padding: 1.5rem 2rem;
}

footer p {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(227, 215, 201, 0.6);
}

/* ========================
   Responsive
   ======================== */

@media (max-width: 640px) {
    nav {
        padding: 1rem 1.25rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 0 1.25rem;
        gap: 1rem;
    }

    .header-text {
        text-align: center;
    }

    .header-content .logo-img {
        height: 120px;
    }

    .header-content h1 {
        font-size: 1.75rem;
    }

    .header-content p {
        font-size: 0.95rem;
    }

    .header-simple .logo-link .logo-img {
        height: 44px;
    }

    .nav-links > li > a,
    .dropdown-btn {
        padding: 0.5rem 0.65rem;
        font-size: 0.85rem;
    }

    main {
        padding: 2rem 1.25rem 3rem;
    }

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

    .dropdown-menu {
        right: -1rem;
    }

    .article h1 {
        font-size: 1.75rem;
    }

    .article h2 {
        font-size: 1.25rem;
    }
}
