/* ========== VARIABLES ========== */
:root {
    --sidebar-width: 240px;
    --header-height: 70px;

    --color-bg: #79b8ff84;
    --color-sidebar: #ffffff;
    --color-sidebar-text: #333333;
    --color-text: #fffdfd;
    --color-muted: #868890;

    --gap: 24px;

    /* Window casing: white painted frame with a soft sheen */
    --frame: linear-gradient(135deg, #ffffff 0%, #f4f4f4 50%, #e9e9e9 100%);
    --frame-edge: #d6d6d6;
    --bar-size: 14px;

    /* Fonts (loaded from Google Fonts in index.html) */
    --font-body: "Jockey One", sans-serif;
    --font-heading: "Jockey One", sans-serif;
    --font-title: "Jockey One", sans-serif;
    --font-mono: "Kode Mono", monospace;
}

/* ========== RESET / BASE ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text);
    /* Custom cursor (picked in the top-right menu); "auto" is the fallback */
    cursor: var(--cursor), auto;
    background: var(--color-bg);
}

/* Flower photo fixed behind the whole page. A fixed layer is used instead of
   `background-attachment: fixed`, which phones (especially iPhones) don't support. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url("assets/flower.jpg?v=2") no-repeat center / cover;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0; /* Removes default browser indentation */
}

a {
    color: inherit;
    text-decoration: none;
    cursor: var(--cursor), pointer;
}

/* ========== CURSORS ==========
   The picker sets data-cursor on <html>; 2 (pug) is the default.
   The two numbers are the click point inside the 32x32 image. */
:root,
:root[data-cursor="2"] {
    --cursor: url("assets/cursor2.png") 16 16;
}

:root[data-cursor="1"] {
    --cursor: url("assets/cursor1.png") 16 16;
}

.cursor-picker {
    margin-left: auto; /* pushes it to the right side of the header */
    display: flex;
    gap: 8px;
}

.cursor-option {
    display: flex;
    padding: 4px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: var(--cursor), pointer;
    transition: border-color 0.2s, background 0.2s;
}

.cursor-option:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cursor-option.is-active {
    border-color: #ffffff;
}

/* Phone/tablet tip: hidden on computers */
.mobile-note {
    display: none;
    margin: 0;
    color: #e0e0e0; /* light gray */
    font-size: 0.9rem;
    line-height: 1.4;
}

.cursor-option img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated; /* keeps the pixel art sharp */
}

/* ========== LAYOUT (CSS Grid) ========== */
.layout {
    display: grid;
    /* Sidebar hidden for now. To restore it, use:
       grid-template-columns: var(--sidebar-width) 1fr;
       grid-template-areas: "web-header web-header" "sidebar content";
       and in .sidebar remove `display: none` and uncomment grid-area */
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-height) 1fr;
    grid-template-areas:
        "web-header"
        "content";
    min-height: 100vh;
}

/* ========== HEADER ========== */
.web-header {
    grid-area: web-header;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    padding: 0 var(--gap);
}

/* Hidden on screen, still read by screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.web-header h1 {
    margin: 0;
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 400;
}

/* ========== SIDEBAR (3 tiers) ========== */
.sidebar {
    display: none; /* hidden for now */
    /* grid-area: sidebar; (restore with the sidebar) */
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    /* display: flex; (restore with the sidebar) */
    flex-direction: column;
    background: var(--color-sidebar);
    color: var(--color-sidebar-text);
}

.sidebar-tier {
    padding: var(--gap) 16px;
}

.sidebar-tier + .sidebar-tier {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-tier p {
    margin: 0;
}

/* Tier 1: name */
.sidebar-name {
    font-family: var(--font-script);
    font-size: 1.5rem;
    line-height: 2;
    color: #000;
}

.sidebar-role {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* Tier 2: navigation (takes the remaining space) */
.sidebar-middle {
    flex: 1;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu a {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.sidebar-menu a:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
}

.sidebar-menu a.active {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}

/* Tier 3: bottom */
.sidebar-bottom {
    font-size: 0.85rem;
}

/* ========== CONTENT / TIERS ========== */
/* Column layout so the goodbye section can sit at the bottom of the page */
.content {
    grid-area: content;
    display: flex;
    flex-direction: column;
}

.tier {
    padding: 16px 40px;
    scroll-margin-top: var(--header-height);
}

.tier h2 {
    margin-top: 0;
    font-family: var(--font-heading);
    font-weight: 400;
}

/* Tier 1: Welcome */
.tier-welcome {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tier-welcome h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.15;
    margin-bottom: 4px;
}

.tier-welcome p {
    margin-top: 0;
    max-width: 60ch;
    font-size: 1.1rem;
}

/* Menus: four columns side by side */
/* Each menu is only as wide as its own content, with the same gap between all of them */
.tier-split {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 80px; /* space between rows, space between menus */
}

/* Details panel: transparent; all entries share one spot,
   only the hovered one is visible */
.details-panel {
    display: grid;
}

.detail {
    grid-area: 1 / 1;
    max-width: 60ch;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.detail.is-visible {
    opacity: 1;
    visibility: visible;
}

.detail h3 {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 400;
}

.detail p {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.detail-label {
    font-family: var(--font-mono);
}

/* "Visit website" link inside a detail */
.detail-link {
    font-family: var(--font-mono);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.detail-link:hover {
    opacity: 0.8;
}

/* Goodbye: pushed to the bottom of the page */
.tier-goodbye {
    margin-top: auto;
}

.tier-goodbye p {
    margin: 0;
    color: var(--color-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .web-header {
        padding: 0 16px;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .sidebar-tier {
        padding: 12px 16px;
    }

    .sidebar-menu {
        display: flex;
        gap: 4px;
        overflow-x: auto;
    }

    .sidebar-menu a {
        margin: 0;
        white-space: nowrap;
    }

    .tier {
        padding: 16px;
    }

    /* Menus: stacked one on top of the other */
    .tier-split {
        flex-direction: column;
        gap: 24px;
    }

    /* Footer message: darker gray (no shadow, so it stays crisp) */
    .tier-goodbye p {
        color: #4a4a4a;
        text-shadow: none;
    }

    /* Keeps white text readable where it overlaps the roses */
    body {
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    }

    /* Larger tap targets for menu links */
    .tier-split a {
        display: inline-block;
        padding: 4px 0;
    }

    /* Keep the roses in view on narrow, tall screens */
    body::before {
        background-position: 78% center;
    }
}

/* ========== TOUCH SCREENS (no mouse to hover with) ========== */
@media (hover: none) {
    /* No mouse pointer, so no cursor picker; show the tip instead */
    .cursor-picker {
        display: none;
    }

    .mobile-note {
        display: block;
    }

    /* Header scrolls away and fits the tip */
    .layout {
        grid-template-rows: auto 1fr;
    }

    .web-header {
        position: static;
        padding: 16px;
    }

    /* Details open on tap; only the open one takes up space */
    .detail {
        display: none;
    }

    .detail.is-visible {
        display: block;
    }
}
