:root {
    --header-height: 2rem;
    --soft-white: #f0f0f0;
    --dark-bg: #1d1e23;
    --accent-blue: #50C878;
    --hover-blue: #80a0ff;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;        /* <- STOP root scrolling */
}

body{
    margin: 0;
    padding: 0;
    font-family: 'Times New Roman', Times, serif;
    background-color: var(--dark-bg);
    color: var(--soft-white);
}

button {
    font-family: 'Times New Roman', Times, serif;
}

@keyframes occasionalWiggle {
    0%   { transform: rotate(0deg); }
    60%   { transform: rotate(0deg); }
    70%  { transform: rotate(2deg); }
    80%  { transform: rotate(-2deg); }
    90%  { transform: rotate(2deg); }
    100%   { transform: rotate(0deg); }
}

.rotate-wiggle {
    /*animation: occasionalWiggle 2s ease-in-out infinite;*/
}

.cage{
    width: min(50vw, 50vh);
    height: min(50vw, 50vh);
    position: absolute;
    cursor: pointer;
    touch-action: none;  /* allow drag gestures instead of scroll */
}

#home{
    flex-direction: row;
}
/* mobile‑first swap: when viewport is narrow, stack and reverse order */
@media (orientation: portrait) {
    #home {
        flex-direction: column-reverse;
    }
}

#cage {
    width: min(50vw, 50vh);    /* 50% of viewport height, works if container = viewport */
    height: min(50vw, 50vh);
}

.cage{
    z-index: 3;
}

.hidden {
    display: none;
}

.transparent{
    opacity: 0;
    pointer-events: none;
}

.cageBackground{
    width: min(50vw, 50vh);
    height: min(50vw, 50vh);
    border: 1px solid var(--soft-white);
    position: absolute;    
    transition: opacity 0.5s ease; /* adjust duration as you like */
}

#cage{
    z-index: 0;
}

#cage1{
    z-index: 4;
}

#cage1, #cage1Background, #cage{
    top:  calc(50vh - min(25vh, 25vw));
    left: calc(50vw - min(25vh, 25vw));
}
#cage2, #cage2Background{
    top: min(5vh, 5vw);
    left: min(5vh, 5vw);
}

#cage3, #cage3Background{
    top: calc(100vh - min(55vh, 55vw));
    left: calc(100vw - min(55vh, 55vw));
}

#cage2Background{
    background-color: rgba(30, 30, 35, 0.3);
}

#cage3Background{
    background-color: rgba(25, 25, 30, 0.2); 
}

@supports (width: 1dvw) {
    .cage,
    .cageBackground {
        width:  min(50dvw, 50dvh);
        height: min(50dvw, 50dvh);
    }

    #cage1,
    #cage1Background  {
        top:  calc(50dvh - min(25dvh, 25dvw));
        left: calc(50dvw - min(25dvh, 25dvw));
    }

    #cage2,
    #cage2Background {
        top:  min(5dvh, 5dvw);
        left: min(5dvh, 5dvw);
    }
  
    #cage3,
    #cage3Background {
        top:  calc(100dvh - min(55dvh, 55dvw));
        left: calc(100dvw - min(55dvh, 55dvw));
    }

    #container{
        width: 100dvw;
        height: 100dvh; 
    }
}

/* Footer */
footer {
    position: absolute;
    bottom: 16px;
    width: 100%;
    text-align: center;
    z-index: 10;
    pointer-events: none; 
}

footer button {
    pointer-events: auto;
}

/* Button styling */
#start {
    font-weight: bold;
    font-size: 1rem;
    color: var(--dark-bg);
    background-color: var(--soft-white);
    padding: 8px 16px;
    border: 1px solid var(--soft-white);
    cursor: pointer;
    transition: background-color 0.15s, transform 0.05s, opacity 0.5s ease;
}
  
/* Hover state */
#start:hover {
    background-color: var(--accent-blue);
    color: var(--soft-white);
}

/* Active (pressed) state */
#start:active {
    background-color: var(--hover-blue);
    transform: translateY(1px);
}

#intro{
    padding: 2rem;
}
  
#intro > * {
    transition: opacity 0.7s ease var(--delay, 0);
}
#intro > .site-title    { --delay: 0s; }
#intro > .role:nth-of-type(1) { --delay: 0.4s; }
#intro > .role:nth-of-type(2) { --delay: 0.7s; }
#intro > #links       { --delay: 1.0s; }

#intro.transparent > * {
    opacity: 0;
}
  
.site-title {
    font-size: clamp(1rem, 6vw, 1.5rem);
    margin: 0;
}

.role {
    font-size: clamp(0.8rem,43vw, 1rem);
    margin: 0.5rem 0;
}

#links {
    display: flex;
    gap: clamp(0.8rem, 4vw, 1rem);
    margin-top: 1rem;
}

#links a {
    font-size: clamp(0.8rem, 4vw, 1rem);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s;
}

#links a:hover {
    color: var(--hover-blue); 
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

a:hover {
    color: var(--hover-blue);
    text-decoration: underline; /* optional */
}

.sections{
    height: 100%;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

section {    
    scroll-snap-align: start;        /* snap to the top of each section */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 100vh;
    scroll-behavior: smooth;
}

@supports (width: 1dvh){
    section{
        min-height: 100dvh;
    }
}

#about div{
    max-width: 80%;
}

.about-content {
    max-width: 600px;                /* never grow past 600px */
    width: 100%;                     /* but shrink to fill */
    margin: 0 auto;                  /* center it */
    padding: 0 1rem;                 /* extra breathing room on very narrow screens */
    box-sizing: border-box;
    text-align: center;
}

.about-content p {
    margin: 1rem 0;
    line-height: 1.5;
}

.about-rule {
    width: 10%;
    margin: 1rem auto;               /* centers the hr */
    border: none;
    border-top: 1px solid #444;
}

/* grid of cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 1.5rem;
    width: 80%;
    max-width: 1000px;
    margin-top: 2rem;
    margin-bottom: 4rem;
    justify-content: center;
}

/* each "card" */
.card {
    background: #111;
    border: 1px solid var(--soft-white);   
    padding: 1.25rem;            
    box-shadow: 0 1px 3px rgba(255,255,255,0.1);
    background-color: rgba(20, 20, 20, 0.7);
}

/* card title */
.card h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

/* container for pill‑tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* the pills */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--soft-white);
    background-color: rgba(40, 40, 40, 0.8);
}

.card p {
    display: block;
}

.project-link{
    margin-top: auto;
}
