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

:root {
    --bg: #fafafa;
    --text: #1a1a1a;
    --text-light: #666;
    --accent: #2a2a2a;
    --nav-bg: #ffffff;
    --border: #e5e5e5;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 1.5s ease, color 1.5s ease;
}

/* === NAVBAR === */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    transition: background 1.5s ease, border-color 1.5s ease;
}

.nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: color 1.5s ease;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 400;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* === TAB CONTENT === */
.tab-content {
    display: none;
    min-height: 100vh;
    padding-top: 64px;
}

.tab-content.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === ABOUT ME / DUALITY SPLIT === */

/* override the default tab centering so the split fills edge-to-edge */
#tab-about.active {
    display: block;
    align-items: unset;
    justify-content: unset;
}

.duality-container {
    width: 100%;
    height: calc(100vh - 64px);
    display: flex;
    position: relative;
}

.duality-half {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.duality-dark {
    background: #1a1a1a;
    color: #e0dbd2;
}

.duality-light {
    background: #f5f0e8;
    color: #1a1a1a;
}

.duality-items {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.duality-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    transform: rotate(var(--r, 0deg));
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.85;
}

.duality-item:hover {
    transform: rotate(0deg) scale(1.08);
    opacity: 1;
}

.sketch-icon {
    width: 52px;
    height: 52px;
}

.duality-item span {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* === EDGE SCATTER === */
.edge-scatter {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.es {
    position: absolute;
    font-family: 'Caveat', cursive;
    color: currentColor;
    transform: rotate(var(--er, 0deg));
    line-height: 1;
    user-select: none;
}

/* === DIVIDER === */
/* Divider: thin line + name running vertically like a book spine */
.duality-divider {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.divider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: linear-gradient(to bottom, transparent 0%, #888 12%, #888 88%, transparent 100%);
    opacity: 0.3;
}

/* photo circle centred on the split line */
.divider-photo {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.divider-photo img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #888;
    display: block;
}

/* img sits on top of placeholder; onerror hides it if file is missing */

.photo-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #2a2a2a;
    border: 3px solid #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    font-weight: 700;
    color: #e0dbd2;
    position: absolute;
    top: 0;
    left: 0;
}

/* name reads top-to-bottom along the divider */
.divider-name {
    font-family: 'Caveat', cursive;
    font-size: 0.78rem;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: #888;
    opacity: 0.5;
    white-space: nowrap;
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

/* === RÓISÍN TAB === */
.roisin-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roisin-intro {
    text-align: center;
    padding: 4rem 2rem;
}

.couple-photo {
    margin-bottom: 2rem;
}

.couple-photo img {
    width: 300px;
    height: 300px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid var(--border);
}

.couple-photo img[src="assets/images/couple.jpg"] {
    display: none;
}

.couple-photo img[src="assets/images/couple.jpg"] ~ .photo-placeholder {
    display: flex;
}

.couple-photo .photo-placeholder {
    width: 300px;
    height: 300px;
    border-radius: 12px;
}

.roisin-intro h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.roisin-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

.start-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.75rem 2.5rem;
    font-size: 1rem;
    font-family: var(--font);
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
}

.start-btn:hover {
    transform: scale(1.05);
}

/* === ANIMATION === */
.animation-wrapper {
    display: none;
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.animation-wrapper.active {
    display: block;
}

#moon-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.reveal-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -1px;
    text-align: center;
    opacity: 0;
    color: #fff;
    text-shadow: 0 0 40px rgba(255, 200, 100, 0.8);
    pointer-events: none;
    transition: opacity 2s ease;
    line-height: 1.3;
}

.reveal-text.visible {
    opacity: 1;
}

/* === HOBBIES TAB === */
.hobbies-container {
    text-align: center;
    padding: 4rem 2rem 5rem;
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

/* seb greeting */
.seb-greeting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.hello-seb {
    font-family: 'Caveat', cursive;
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text);
    transform: rotate(-1.5deg);
    display: inline-block;
}

.slapping-cheeks {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: 1px;
    transform: rotate(1deg);
    display: inline-block;
}

/* monkey illustration */
.monkey-wrap {
    display: flex;
    justify-content: center;
}

.monkey-svg {
    width: 200px;
    height: 182px;
    animation: monkey-bounce 0.7s ease-in-out infinite alternate;
}

@keyframes monkey-bounce {
    from { transform: translateY(0) rotate(-1deg); }
    to   { transform: translateY(-6px) rotate(1deg); }
}

/* hands pat inward then relax */
.monkey-left-hand {
    animation: left-pat 0.7s ease-in-out infinite alternate;
    transform-origin: 58px 106px;
}
.monkey-right-hand {
    animation: right-pat 0.7s ease-in-out infinite alternate;
    transform-origin: 162px 106px;
}

@keyframes left-pat {
    from { transform: translateX(0); }
    to   { transform: translateX(6px); }
}
@keyframes right-pat {
    from { transform: translateX(0); }
    to   { transform: translateX(-6px); }
}

/* badminton */
.badminton-scene {
    width: 100%;
    max-width: 700px;
}

.badminton-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

/* racket arm swings — shoulder is pivot */
.seb-arm {
    animation: seb-swing 3.2s ease-in-out infinite;
}
.mik-arm {
    animation: mik-swing 3.2s ease-in-out infinite;
}

/* seb hits at t=0 (and t=3.2s), mik at t=1.6s */
@keyframes seb-swing {
    0%   { transform: rotate(-20deg); }
    6%   { transform: rotate(35deg);  }   /* impact */
    14%  { transform: rotate(-10deg); }   /* follow-through */
    45%, 95% { transform: rotate(-20deg); }
    100% { transform: rotate(-20deg); }
}

@keyframes mik-swing {
    0%, 44%  { transform: rotate(20deg);  }  /* resting */
    50%      { transform: rotate(-35deg); }   /* impact */
    58%      { transform: rotate(10deg);  }   /* follow-through */
    90%      { transform: rotate(20deg);  }
    100%     { transform: rotate(20deg);  }
}

/* shuttle: nested groups let X and Y animate independently */
.shuttle-x {
    /* starts near seb's racket */
    animation: sx 1.6s linear infinite alternate;
}
.shuttle-y {
    animation: sy 1.6s ease-in-out infinite alternate;
}

@keyframes sx {
    from { transform: translateX(168px); }  /* near seb */
    to   { transform: translateX(532px); }  /* near mik */
}

@keyframes sy {
    from { transform: translateY(186px); }  /* racket height */
    50%  { transform: translateY(80px);  }  /* arc peak */
    to   { transform: translateY(186px); }  /* racket height */
}

/* === ROISIN COLOR TRANSITION STATES === */
body.roisin-phase-1 {
    background: #f0f4f8;
}

body.roisin-phase-2 {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.roisin-phase-2 #navbar {
    background: #1a1a2e;
    border-color: #2a2a4e;
}

body.roisin-phase-2 .nav-logo,
body.roisin-phase-2 .nav-link {
    color: #e0e0e0;
}

body.roisin-phase-3 {
    background: #0d0d1a;
    color: #fff;
}

body.roisin-phase-3 #navbar {
    background: #0d0d1a;
    border-color: #1a1a3a;
}

body.roisin-phase-3 .nav-logo,
body.roisin-phase-3 .nav-link {
    color: #fff;
}

/* Light burst on landing */
body.roisin-burst {
    animation: lightBurst 1.5s ease-out;
}

@keyframes lightBurst {
    0% {
        background: #fff;
    }
    30% {
        background: #fffbe6;
    }
    100% {
        background: #0d0d1a;
    }
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.8rem;
    }

    .reveal-text {
        font-size: 1.8rem;
        padding: 0 1rem;
    }

    .couple-photo img,
    .couple-photo .photo-placeholder {
        width: 220px;
        height: 220px;
    }

    /* duality: stack vertically on mobile */
    .duality-container {
        flex-direction: column;
        height: auto;
    }

    .duality-half {
        min-height: 50vh;
        padding: 3rem 1.5rem;
    }

    .duality-items {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }

    /* divider becomes a horizontal line */
    .duality-divider {
        position: relative;
        left: auto;
        top: auto;
        bottom: auto;
        transform: none;
        width: 100%;
        height: 48px;
        flex-direction: row;
    }

    .divider-line {
        top: 50%;
        bottom: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 1px;
        transform: translateY(-50%);
        background: linear-gradient(to right, transparent 0%, #888 12%, #888 88%, transparent 100%);
    }

    .divider-name {
        writing-mode: horizontal-tb;
        letter-spacing: 2.5px;
        font-size: 0.75rem;
    }
}

/* === DIALER (hidden, revealed by 5-tap easter egg on MP logo) === */
.dialer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dialer-overlay.active {
    display: flex;
    animation: dialer-fade 0.25s ease-out;
}

@keyframes dialer-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dialer-frame {
    width: min(340px, 92vw);
    background: #1c1c1e;
    border-radius: 28px;
    padding: 1.2rem 1.5rem 1.6rem;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.dialer-close {
    position: absolute;
    top: 0.6rem;
    right: 0.9rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
}
.dialer-close:hover { color: white; }

.dialer-display {
    min-height: 52px;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-align: center;
    padding: 0.8rem 0;
    margin-bottom: 0.6rem;
    color: white;
    word-break: break-all;
}

.dialer-keys {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.dkey {
    background: #2c2c2e;
    border: none;
    border-radius: 50%;
    width: 72px;
    height: 72px;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.1s ease, transform 0.08s ease;
    margin: 0 auto;
}

.dkey:active, .dkey:hover {
    background: #3a3a3c;
    transform: scale(0.96);
}

.dkey .dd {
    font-size: 1.7rem;
    font-weight: 400;
    line-height: 1;
}

.dkey .dl {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.55);
    margin-top: 0.1rem;
    height: 0.7rem;
}

.dialer-actions {
    display: grid;
    grid-template-columns: 1fr 72px 1fr;
    gap: 0.65rem;
    align-items: center;
    justify-items: center;
}

.dialer-call {
    background: #34c759;
    border: none;
    border-radius: 50%;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.1s ease, transform 0.08s ease;
}
.dialer-call:hover { background: #2dad4e; transform: scale(0.96); }

.dialer-del {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
}
.dialer-del:hover { color: white; }

/* feedback states */
.dialer-feedback {
    min-height: 40px;
    margin-top: 0.8rem;
    text-align: center;
    font-size: 0.95rem;
}

.dialer-frame.shake {
    animation: dialer-shake 0.45s ease-in-out;
}
@keyframes dialer-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.dialer-frame.success {
    animation: dialer-pulse 0.5s ease-out;
}
@keyframes dialer-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6); }
    100% { box-shadow: 0 0 0 40px rgba(52, 199, 89, 0); }
}

.dialer-feedback.win {
    color: #34c759;
    font-weight: 600;
    letter-spacing: 1px;
}

.dialer-reveal {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.dialer-reveal-section {
    color: rgba(255,255,255,0.5);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 0.4rem;
    padding-left: 0.2rem;
}

.dialer-reveal-section:first-child {
    margin-top: 0;
}

.dialer-reveal-item {
    background: #2c2c2e;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
}
.dialer-reveal-item:hover { background: #3a3a3c; }

.dialer-reveal-item .rl {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.dialer-reveal-item .rn {
    font-size: 1.05rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.dialer-reveal-item.copied .rn::after {
    content: ' ✓';
    color: #34c759;
}
