/* Shared styles for gentlealgorithm pages (homepage + standalone dialog-style pages) */

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

body {
    font-family: 'Helvetica', Arial, sans-serif;
    color: #fff;
    background-color: #162310;
    background-image: url('/assets/grass-sky.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

header {
    padding: 2rem 5vw;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1rem;
    font-weight: 600;
}

header button,
.header-btn {
    background: #fff;
    padding: 1rem;
    border: 1px solid black;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #162310;
    text-decoration: none;
    display: inline-block;
}

/* Contact dropdown (injected into every header by /assets/site.js) */
.contact-wrap {
    position: relative;
}

.contact-menu {
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    pointer-events: none;
}

.contact-menu.open {
    pointer-events: auto;
}

.social-icons a {
    display: inline-block;
    font-size: 2rem;
    margin-bottom: 8px;
    text-decoration: none;
    opacity: 0;
    transform: rotate(0deg) translateY(0) scale(0.4);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.social-icons a img {
    width: 28px;
    height: 28px;
    display: block;
}

.emoji-button {
    font-size: 2rem;
    text-decoration: none;
}

.contact-menu.open .social-icons a {
    opacity: 1;
    transform: rotate(var(--rot, 0deg)) translateY(var(--ty, 0)) scale(1);
}

.contact-menu.open .social-icons a:hover {
    transform: rotate(var(--rot, 0deg)) translateY(calc(var(--ty, 0px) - 4px)) scale(1);
}

.social-icons a:nth-child(1) {
    --rot: -14deg;
    --ty: 6px;
}

.social-icons a:nth-child(2) {
    --rot: 0;
    --ty: 0px;
}

.social-icons a:nth-child(3) {
    --rot: 14deg;
    --ty: 6px;
}

.contact-menu.open .social-icons a:nth-child(1) {
    transition-delay: 0s;
}

.contact-menu.open .social-icons a:nth-child(2) {
    transition-delay: 0.04s;
}

.contact-menu.open .social-icons a:nth-child(3) {
    transition-delay: 0.08s;
}

.email-btn {
    background: #fff;
    padding: 1rem;
    border: 1px solid black;
    font-size: 0.85rem;
    font-weight: 600;
    color: #006EE9;
    text-decoration: none;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-8px) scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.contact-menu.open .email-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.16s;
}

main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    padding: 8rem 1.5rem 5rem;
}

/* Dialog (used both as an in-page modal on the homepage and as the layout for standalone pages) */
.dialog-view {
    width: 100%;
    max-width: 650px;
}

.dialog-container {
    width: 100%;
    background: #fff;
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.2);
}

.dialog-bar {
    flex-shrink: 0;
    width: 100%;
    background-color: #F8E8EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
}

#dialog-dots,
.dialog-close-link {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
}

#dialog-dots:hover,
.dialog-close-link:hover {
    opacity: 0.8;
}

.dot {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    border: none;
    display: inline-block;
    padding: 0;
}

.dot-coral {
    background-color: coral;
}

.dot-lime {
    background-color: lime;
}

.dot-blue {
    background-color: dodgerblue;
}

.dialog-body {
    width: 100%;
    background: #fff;
}

.dialog-markdown {
    padding: 2rem;
    line-height: 1.6;
    color: #162310;
    font-size: 0.95rem;
}

.dialog-markdown h1 {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
    color: #000;
}

.dialog-markdown h2,
.dialog-markdown h3 {
    font-size: 1.15rem;
    margin: 1.2rem 0 0.4rem;
    color: #000;
}

.dialog-markdown p {
    margin-bottom: 0.9rem;
}

.dialog-markdown ul {
    margin: 0.4rem 0 1rem 1.4rem;
}

.dialog-markdown li {
    margin-bottom: 0.35rem;
}

.dialog-markdown a {
    color: #006EE9;
    text-decoration: underline;
}

/* Floating links menu (present on every page) */
.floating-links-wrap {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.floating-links-btn {
    background: #fff;
    padding: 0.8rem 1.2rem;
    border: 1px solid black;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
}

.floating-links-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid black;
    display: none;
    flex-direction: column;
    width: 240px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.floating-links-menu.open {
    display: flex;
}

.floating-links-menu a {
    padding: 1rem 1rem;
    color: #162310;
    text-decoration: none;
    font-size: 1rem;

    border-bottom: 1px solid #eee;
}

.floating-links-menu a:last-child {
    border-bottom: none;
}

.floating-links-menu a:hover {
    background: #F8E8EB;
    color: #FF48AA;
}

@media (max-width: 768px) {
    header {
        padding: 1.5rem 4vw;
    }

    main {
        padding: 7rem 1.25rem 5rem;
    }

    .floating-links-wrap {
        bottom: 1.25rem;
        right: 1.25rem;
    }
}