/* =========================
   VARIABLES / THEME
========================= */
:root {
    --text: rgb(52, 52, 77);
    --line: #dbc39d;
    --accent: #666571;
    --fill: rgba(255, 255, 255, 0.85);
}

/* normal link */
a {
    color: #dbc39d;
}

/* when hovering */
a:hover {
    color: #666571;
    background-color: #dbc39d;
}

/* when clicking */
a:active {
    color: #dbc39d;
}

/* =========================
   FONT SETUP
========================= */
@font-face {
    font-family: "TerminalGrotesque";
    src: url("fonts/terminal-grotesque.ttf") format("truetype");
}

body {
    font-family: "TerminalGrotesque", monospace;
    color: var(--text);
}

/* =========================
   RESET + GLOBAL STYLES
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-color: var(--text) var(--line);
}

img {
    max-width: 100%;
}

/* =========================
   SCROLLBAR STYLING
========================= */
*::-webkit-scrollbar {
    width: 20px;
}

*::-webkit-scrollbar-track {
    background: var(--line);
}

*::-webkit-scrollbar-thumb {
    background-color: var(--text);
}

/* =========================
   LAYOUT STRUCTURE
========================= */
nav {
    float: left;
    width: 15%;
    height: 100vh;
    position: relative;
    background-color: var(--bg);
}

main {
    float: left;
    width: 85%;
    height: 100vh;
    padding: 2em;
    overflow-y: auto;
    background-color: var(--bg);
}

.container {
    max-width: 1500px;
}

/* =========================
   NAVIGATION
========================= */
nav div {
    position: absolute;
    top: 50%;
    right: -1.5vw;
    transform: translateY(-50%);
    text-align: right;
}

nav a {
    display: block;
    margin: 10px 0;
    font-size: 2em;
    text-decoration: none;
    color: var(--fill);
    filter: drop-shadow(1px 1px 0 var(--text)) drop-shadow(-1px 1px 0 var(--text)) drop-shadow(0 -1px 0 var(--text))
        drop-shadow(1px 0 var(--text));
}

nav a:hover,
nav a:focus {
    color: var(--accent);
}

/* =========================
   SECTIONS / CONTENT BOXES
========================= */
section {
    margin: 2em 0;
    padding: 1em 2em;
    background-color: var(--fill);
    border: 2px solid var(--line);
    border-radius: 5px;
}

.box {
    height: 200px;
    overflow-y: auto;
}

.photopile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}
.photopile figure {
    display: inline-block;
    background: whitesmoke;
    box-shadow: 1px 4px 5px rgba(0, 0, 0, 0.55);
    transform: rotate(2deg);
    margin: 0 -10px;
}
.photopile figure img {
    max-width: calc(100% - 2rem);
    margin: 1rem 1rem 0 1rem;
    border: 2px rgb(0, 0, 0, 0.55) inset;
}
.photopile figcaption,
.popovers figcaption {
    font-family: "TerminalGrotesque", monospace;
    text-align: center;
    margin: 0.5rem 1rem 1rem 1rem;
    font-size: 1rem;
    color: black;
}
.photopile button {
    background: none;
    border: none;
    max-width: 40%;
}
.photopile button:hover,
.photopile button:focus {
    z-index: 3;
    cursor: pointer;
}
.photopile button:nth-child(2n) {
    transform: rotate(-10deg);
}
.photopile button:nth-child(3n) {
    transform: rotate(5deg);
}
.photopile button:nth-child(4n) {
    transform: rotate(4deg);
}
.photopile button:nth-child(5n) {
    transform: rotate(-2deg);
}
.photopile button:nth-child(6n) {
    transform: rotate(-7deg);
}

:popover-open {
    border: none;
    box-shadow: 1px 4px 5px rgba(0, 0, 0, 0.55);
    position: fixed;
    top: 50vh;
    left: 50vw;
    transform: translate(-50%, -50%);
}
.popovers figure:popover-open {
    display: block;
    background: white;
    width: 88vmin;
}
.popovers figure:popover-open figcaption {
    margin: 2.5vmin 1rem 4vmin 1rem;
    font-size: 175%;
    color: black;
}
.popovers figure:popover-open img {
    margin: 4vmin 4vmin 0 4vmin;
    width: 80vmin;
    border: 4px rgb(0, 0, 0, 0.55) inset;
}

/* =========================
   LINKED PHOTO PILE
========================= */

.photopile.links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}
.photopile.links figure {
    display: inline-block;
    background: whitesmoke;
    box-shadow: 1px 4px 5px rgba(0, 0, 0, 0.55);
    transform: rotate(2deg);
    margin: 15px;
}
.photopile.links figure img {
    max-width: calc(100% - 2rem);
    margin: 1rem 1rem 0 1rem;
    border: 2px rgb(0, 0, 0, 0.55) inset;
}
.photopile.links figcaption,
.popovers figcaption {
    font-family: "TerminalGrotesque", monospace;
    text-align: center;
    margin: 0.5rem 1rem 1rem 1rem;
    font-size: 1rem;
    color: black;
}
.photopile button {
    background: none;
    border: none;
    max-width: 25%;
}

/* normal rotations */
.photopile.links a:nth-child(1) figure {
    transform: rotate(-5deg);
}
.photopile.links a:nth-child(2) figure {
    transform: rotate(4deg);
}
.photopile.links a:nth-child(3) figure {
    transform: rotate(-2deg);
}
.photopile.links a:nth-child(4) figure {
    transform: rotate(6deg);
}
.photopile.links a:nth-child(5) figure {
    transform: rotate(-4deg);
}
.photopile.links a:nth-child(6) figure {
    transform: rotate(3deg);
}
.photopile.links a:nth-child(7) figure {
    transform: rotate(-6deg);
}
.photopile.links a:nth-child(8) figure {
    transform: rotate(5deg);
}

/* further rotation on hover */
.photopile.links a:nth-child(1):hover figure {
    transform: rotate(-9deg) scale(1.06);
}

.photopile.links a:nth-child(2):hover figure {
    transform: rotate(8deg) scale(1.06);
}

.photopile.links a:nth-child(3):hover figure {
    transform: rotate(-6deg) scale(1.06);
}

.photopile.links a:nth-child(4):hover figure {
    transform: rotate(10deg) scale(1.06);
}

.photopile.links a:nth-child(5):hover figure {
    transform: rotate(-8deg) scale(1.06);
}

.photopile.links a:nth-child(6):hover figure {
    transform: rotate(7deg) scale(1.06);
}

.photopile.links a:nth-child(7):hover figure {
    transform: rotate(-10deg) scale(1.06);
}

.photopile.links a:nth-child(8):hover figure {
    transform: rotate(9deg) scale(1.06);
}

.photopile.links a:hover figure {
    z-index: 10;
    box-shadow: 6px 10px 16px rgba(0, 0, 0, 0.5);
}

.photopile.links img {
    width: 100%;
    display: block;
    border: 2px inset rgba(0, 0, 0, 0.4);
}

.photopile.links figcaption {
    margin-top: 0.5rem;
    text-align: center;
    font-family: "TerminalGrotesque", monospace;
    font-size: 0.9rem;
    color: black;
    line-height: 1.3;
}

/* =========================
   HEADER / HERO
========================= */
header {
    background-image: url("images/header1.png");
    background-size: cover;
    background-position: center;
    padding: 20px 30px;
    margin-bottom: 2rem;
    border-radius: 8px;

    font-size: 2em;
    color: var(--fill);

    font-family: "TerminalGrotesque", monospace;

    -webkit-text-stroke: 2px var(--text);
    text-shadow: 2px 2px 0 var(--text);
    filter: drop-shadow(1px 1px 0 var(--text)) drop-shadow(-1px 1px 0 var(--text)) drop-shadow(0 -1px 0 var(--text))
        drop-shadow(1px 0 var(--text));
}

/* =========================
   TYPOGRAPHY
========================= */
h2,
h3,
h4,
h5,
h6,
p,
table,
details,
cite,
blockquote {
    margin: 1rem 0;
}

ul,
ol,
dl {
    margin: 1rem 0 1rem 2rem;
}

ul ul,
ol ol {
    margin-left: 2rem;
}

p,
table,
ul,
ol,
dl {
    font-size: 1rem;
}

h2 {
    font-size: 2em;
    text-align: center;
    background-color: var(--accent);
    padding: 5px;
    border-radius: 8px;
}

h3 {
    font-size: 1.75em;
    background-color: var(--accent);
    border-radius: 8px;
}
h4 {
    font-size: 1.5em;
}
h5 {
    font-size: 1.25em;
}
h6 {
    font-size: 1em;
}

/* =========================
   LINKS
========================= */
a {
    color: var(--accent);
    padding: 2px;
}

p a:hover {
    color: var(--fill);
    background-color: var(--accent);
}

/* =========================
   BLOCK ELEMENTS
========================= */
blockquote {
    background-color: var(--accent);
    color: var(--fill);
    padding: 1em;
}

blockquote a,
blockquote code {
    color: var(--text);
}

cite {
    display: block;
    text-align: right;
}

code,
details,
pre {
    background-color: var(--bg);
}

code {
    font-family: "TerminalGrotesque", monospace;
    padding: 2px;
}

details,
pre {
    padding: 1em;
}

pre {
    overflow-x: auto;
}

/* =========================
   TABLES
========================= */
table {
    border: 5px solid var(--line);
}

tr,
td,
th {
    border: 2px solid var(--line);
}

td,
th {
    padding: 3px;
}

/* =========================
   FLEX GRID SYSTEM
========================= */
.flex-box {
    display: flex;
    flex-wrap: wrap;
    margin: -1em;
    align-items: flex-start;
}

.flex-box section {
    margin: 1em;
}

.full {
    flex: 1 1 100%;
}
.half {
    flex: 1 1 calc(50% - 2em);
}
.third {
    flex: 1 1 calc(33% - 2em);
}
.twothird {
    flex: 1 1 calc(66% - 2em);
}
.quarter {
    flex: 1 1 calc(25% - 2em);
}
.threequarter {
    flex: 1 1 calc(75% - 2em);
}

/* =========================
   INTRO (IMAGE + TEXT)
========================= */
.intro {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.intro-image {
    width: 180px;
    flex: 0 0 180px;
    overflow: hidden;
    order: 2;
}

.intro-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.intro-text {
    flex: 1;
    order: 1;
}

/* =========================
   FOOTER
========================= */
footer {
    text-align: center;
    background-color: var(--accent);
    margin-top: 2em;
    padding: 5px;
    border-radius: 8px;
}

footer a {
    color: var(--text);
}

/* =========================
   RESPONSIVE (MOBILE)
========================= */
@media screen and (max-width: 800px) {
    nav,
    main,
    .stripe {
        float: none;
        width: 100%;
        height: auto;
    }

    nav {
        padding: 2vw;
    }

    nav div {
        position: static;
        transform: none;
        width: 100%;
        text-align: right;
    }

    nav a {
        display: inline-block;
        margin: 5px;
    }

    nav a::after {
        content: " ↗";
    }

    main {
        padding: 2em 1em;
    }

    header {
        text-align: center;
        font-size: 1.5em;
    }

    section {
        padding: 0 1em;
    }

    .stripe {
        height: 30px;
    }

    *::-webkit-scrollbar {
        width: 10px;
    }
}

/* layout fix */
#HCB_comment_box {
    display: flex;
    flex-direction: column;
    border: none;
    background: transparent;
    padding: 0;
}

/* correct order */
#HCB_comment_form_box {
    order: 1;
}
#hcb_msg {
    order: 2;
    margin-top: 10px;
}
#comments_list {
    order: 3;
    margin-top: 10px;
}

/* style header */
#HCB_comment_box h3 {
    background: var(--accent);
    color: var(--fill);
    font-family: "TerminalGrotesque", monospace;
    font-size: 2em;
    text-align: center;
    padding: 5px;
    margin: 1rem 0;
}

/* inputs */
#HCB_comment_box input,
#HCB_comment_box textarea {
    background: var(--bg);
    border: 2px solid var(--line);
    color: var(--text);
    font-family: "TerminalGrotesque", monospace;
    width: 100%;
}

/* =========================
   GUESTBOOK FORM
========================= */
.guest-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.guest-form input,
.guest-form textarea {
    width: 100%;
    font-family: "TerminalGrotesque", monospace;
    font-size: 1rem;

    background: var(--fill);
    color: var(--text);

    border: 2px solid var(--line);
    padding: 0.5rem;

    box-sizing: border-box;
}

/* make textarea same visual weight */
.guest-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* submit button */
.guest-form button {
    align-self: flex-start;

    font-family: "TerminalGrotesque", monospace;
    background: var(--accent);
    color: var(--fill);

    border: none;
    padding: 0.4rem 0.8rem;

    cursor: pointer;
}

.guest-form button:hover {
    background: var(--text);
}

/* =========================
   INTERESTS TABS
========================= */

.interests {
    margin-top: 2rem;
}

/* hide radio buttons */
.tabs input {
    display: none;
}

/* tab labels */
.tab-labels {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tab-labels label {
    background: var(--accent);
    color: white;
    padding: 6px 12px;
    cursor: pointer;
    font-family: TerminalGrotesque, monospace;
    font-size: 0.9rem;
    border: 2px solid var(--line);
}

/* hover */
.tab-labels label:hover {
    background: var(--text);
}

/* content box */
.tab-content {
    background: #e8a65c; /* warm orange like screenshot */
    padding: 1rem;
    border: 2px solid var(--line);
}

/* grid */
.content {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.content img {
    width: 100%;
    border: 3px solid white;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ACTIVE TAB SWITCHING */

/* games */
#tab-games:checked ~ .tab-content .games {
    display: grid;
}

/* movies */
#tab-movies:checked ~ .tab-content .movies {
    display: grid;
}

/* tv */
#tab-tv:checked ~ .tab-content .tv {
    display: grid;
}

/* books */
#tab-books:checked ~ .tab-content .books {
    display: grid;
}

/* albums */
#tab-albums:checked ~ .tab-content .albums {
    display: grid;
}

/* =========================
CLADOGRAM
========================= */

.cladogram {
    font-family: "TerminalGrotesque", monospace;
    color: #dbc39d;
}

/* remove default marker */
.cladogram summary {
    list-style: none;
    cursor: pointer;
    position: relative;
}

/* arrow */
.cladogram summary::before {
    content: "▶";
    color: rgb(52, 52, 77);
    margin-right: 6px;
}

.cladogram details[open] > summary::before {
    content: "▼";
}

/* TREE STRUCTURE */
.cladogram details {
    position: relative;
    margin-left: 20px;
    padding-left: 20px;
}

/* vertical line */
.cladogram details::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 1px;
    background: rgb(52, 52, 77);
}

/* horizontal connector */
.cladogram summary::after {
    content: "";
    position: absolute;
    top: 0.9em;
    left: -20px;
    width: 20px;
    height: 1px;
    background: rgb(52, 52, 77);
}

/* lists */
.cladogram ul {
    list-style: none;
    margin: 0;
    padding-left: 20px;
    position: relative;
}

.cladogram ul::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 1px;
    background: rgb(52, 52, 77);
}

.cladogram li {
    position: relative;
    margin: 4px 0;
    padding-left: 20px;
}

.cladogram li::before {
    content: "";
    position: absolute;
    top: 0.8em;
    left: 0;
    width: 20px;
    height: 1px;
    background: rgb(52, 52, 77);
}

/* stop vertical line cleanly */
.cladogram li:last-child::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0.8em;
    bottom: 0;
    width: 1px;
    background: var(--fill); /* blends into background */
}

/* links */
.cladogram a {
    color: rgb(52, 52, 77);
    text-decoration: none;
}

.cladogram a:hover {
    color: #666571;
    background: #dbc39d;
}

/* =========================
LIFELIST LAYOUT (2 BOXES)
========================= */

.lifelist-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
    align-items: start;
}

/* LEFT BIG BOX */
.lifelist-content {
    background: var(--fill);
    border: 2px solid var(--line);
    padding: 1.5rem;
    border-radius: 5px;
    min-width: 0; /* prevents overflow bugs */
}

/* title */
.lifelist-title {
    background: #666571;
    padding: 10px;
    margin-bottom: 1rem;
    text-align: center;
}

/* description */
.lifelist-desc {
    margin-bottom: 1rem;
}

/* tree wrapper */
.lifelist-main {
    overflow-x: auto;
}

/* RIGHT SIDEBAR */
.lifelist-side {
    background: var(--fill);
    color: rgb(52, 52, 77);
    border: 2px solid var(--line);
    border-radius: 5px;
    padding: 20px;
    font-family: "TerminalGrotesque", monospace;
    height: fit-content;
    text-align: center;
}

.lifelist-image {
    display: block;
    margin: 0 auto;
    width: 200px;
    height: 200px;
    flex: 0 0 180px;
    overflow: hidden;
    border: 2px solid var(--line);
}

/* mobile */
@media (max-width: 800px) {
    .lifelist-layout {
        grid-template-columns: 1fr;
    }
}

body {
    background-image: url("images/sea.png");
    background-size: cover; /* makes it fill the screen */
    background-position: center; /* keeps it centered */
    background-repeat: no-repeat; /* prevents tiling */
    background-attachment: fixed; /* optional: makes it stay still when scrolling */
}
