@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
    --cream: #E8E0D4;
    --black: #0a0a0a;
    --gray-muted: #6b6b60;
    --sidebar-width: clamp(180px, 25vw, 320px);
}

/* Dark mode (default) — applied via light-mode class due to inverted class logic */
body,
body.light-mode {
    --bg: #0a0a0a;
    --sidebar-bg: #E8E0D4;
    --fg: #c8c0b4;
    --fg-heading: #E8E0D4;
    --fg-muted: #6b6b60;
    --letter-color: #0a0a0a;
    --nav-active-bg: rgba(232, 224, 212, 0.08);
    --nav-active-fg: #E8E0D4;
    --nav-fg: #6b6b60;
    --link: #E8E0D4;
    --link-hover: #ffffff;
    --toggle-fg: #6b6b60;
}

/* Light mode — applied via dark-mode class due to inverted class logic */
body.dark-mode {
    --bg: #E8E0D4;
    --sidebar-bg: #0a0a0a;
    --fg: #2c2c28;
    --fg-heading: #1a1a18;
    --fg-muted: #6b6b60;
    --letter-color: #E8E0D4;
    --nav-active-bg: rgba(0, 0, 0, 0.08);
    --nav-active-fg: #1a1a18;
    --nav-fg: #6b6b60;
    --link: #2c2c28;
    --link-hover: #0a0a0a;
    --toggle-fg: #6b6b60;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--fg);
    background-color: var(--bg);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.landing {
    overflow: hidden;
}

/* Sidebar */
.vertical-name {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--letter-color);
    z-index: 1000;
    pointer-events: none;
}

.vertical-name svg {
    width: 100%;
    height: 100%;
}

/* Mobile horizontal bar — hidden on desktop */
.mobile-name {
    display: none;
    width: 100%;
    height: 80px;
    background: var(--sidebar-bg);
    overflow: hidden;
    color: var(--letter-color);
}

.mobile-name svg {
    width: 100%;
    height: 100%;
}

/* Paths in the mobile SVG have no fill attribute, so set via CSS */
.mobile-name svg path {
    fill: currentColor;
}

/* Theme toggle */
.theme-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    color: var(--toggle-fg);
    transition: color 0.3s ease;
}

.theme-toggle:hover {
    color: var(--fg);
}

.icon-sun,
.icon-moon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.icon-sun svg,
.icon-moon svg {
    width: 20px;
    height: 20px;
}

/* Dark mode: show sun icon (click to switch to light) */
body.dark-mode .icon-sun { opacity: 1; }
body.dark-mode .icon-moon { opacity: 0; }

/* Light mode: show moon icon (click to switch to dark) */
body.light-mode .icon-sun { opacity: 0; }
body.light-mode .icon-moon { opacity: 1; }

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc((34vh - 3.5rem) / 3) 3rem 3rem;
    position: relative;
}

nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-bottom: 2rem;
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    font-family: 'DM Sans', sans-serif;
    color: var(--nav-fg);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.nav-btn:hover {
    color: var(--fg-heading);
    background-color: var(--nav-active-bg);
}

.nav-btn.active {
    color: var(--nav-active-fg);
    font-weight: 500;
    background-color: var(--nav-active-bg);
}

/* Circle landing state */
.circle-landing {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: opacity 0.25s ease;
    color: var(--fg-heading);
}

.circle-landing svg {
    width: auto;
    height: 55vh;
    max-height: 55vh;
    max-width: 100%;
}

.circle-landing.hidden {
    display: none;
}

/* Content sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
    max-width: 640px;
    width: 100%;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2vh;
}

h2 {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--fg-heading);
    margin-bottom: 1.25rem;
    transition: color 0.3s ease;
}

h3 {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--fg-heading);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

p {
    color: var(--fg);
    transition: color 0.3s ease;
}

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
}

.muted-italic {
    color: var(--fg-muted);
    font-style: italic;
}

.working-title {
    font-weight: 300;
    font-size: 0.9em;
    color: var(--fg-muted);
}

/* Mobile: ≤768px — FRANK fixed at bottom */
@media (max-width: 768px) {
    .vertical-name {
        display: none;
    }

    .mobile-name {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        height: 80px;
    }

    .main-content {
        margin-left: 0;
        min-height: calc(100vh - 80px);
        padding: 1.5rem 1.25rem;
        padding-bottom: calc(80px + 1.5rem);
    }

    .nav-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
}
