/* =============================================
   TERRARIA-STYLE PERSONAL WEBSITE
   ============================================= */

@font-face {
    font-family: 'Terraria';
    src: url('Terraria.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

:root {
    --tr-gold:         #f0c040;
    --tr-text:         #dde6ff;
    --tr-panel-bg:     rgba(10, 15, 50, 0.82);
    --tr-panel-border: #4a5aaa;
    --section-bg:      #0a0e28;
    --section-alt:     #06091a;
    --font-menu:       'Terraria', sans-serif;
    --font-title:      'Terraria', sans-serif;
    --font-body:       'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    background: #0a0e28;
    color: var(--tr-text);
    overflow-x: hidden;
}

/* =============================================
   BACKGROUND — real Terraria screenshot
   ============================================= */

.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url('terraria-bg.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 20, 0.18);
}

/* Sun glow pulse */
@keyframes sun-pulse {
    0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1);    }
    50%       { opacity: 0.85; transform: translate(-50%, -50%) scale(1.18); }
}

.sun-glow {
    position: fixed;
    left: 49%;
    top: 34.8%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 255, 200, 0.7) 0%,
        rgba(255, 230, 100, 0.35) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 1;
    animation: sun-pulse 4s ease-in-out infinite;
}

#leaves-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    width: 100%;
    height: 100%;
}

/* =============================================
   HERO — full viewport, children absolutely
   placed at Terraria screenshot coordinates
   (image is 1366×768, 16:9)
   ============================================= */

.hero {
    position: relative;
    z-index: 10;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* =============================================
   HERO LOGO — animated, centered near top
   ============================================= */

@keyframes logo-pulse {
    0%, 100% { transform: scale(1)    rotate(0deg);  }
    25%       { transform: scale(1.04) rotate(-2deg); }
    75%       { transform: scale(1.04) rotate(2deg);  }
}

.hero-logo-group {
    position: absolute;
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.hero-logos {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    animation: logo-pulse 3s ease-in-out infinite;
}

/* Push Patel down to align its text with Eashan text (tree occupies top 38%) */
.hero-logos .hero-logo:last-child {
    margin-top: clamp(10px, 1.6vw, 28px);
    margin-left: -22px;
}

.hero-logo {
    height: clamp(80px, 11vw, 190px);
    width: auto;
    image-rendering: pixelated;
}

.hero-subtitle {
    position: absolute;
    bottom: 2.6%;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-menu);
    color: var(--tr-text);
    font-size: clamp(10px, 1.2vw, 15px);
    letter-spacing: 2px;
    text-shadow: 1px 1px 0 #000, 0 0 10px rgba(0,0,0,0.9);
    text-align: center;
    white-space: nowrap;
    opacity: 0.85;
    pointer-events: none;
}

/* =============================================
   PLAYER NAME — below logo at ~22% from top
   Logo in image ends ~y=155px (20.2%)
   ============================================= */

.player-name {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.player-title {
    display: block;
    font-family: var(--font-menu);
    font-weight: 700;
    font-size: clamp(14px, 2.4vh, 22px);
    color: #e8d898;
    letter-spacing: 4px;
    text-shadow:
        1px 1px 0 #3a2800,
        0 0 16px rgba(240, 210, 100, 0.7);
    text-transform: uppercase;
}

.player-sub {
    display: block;
    font-family: var(--font-menu);
    font-weight: 600;
    font-size: clamp(9px, 1.4vh, 13px);
    color: #8899cc;
    letter-spacing: 5px;
    margin-top: 4px;
    text-shadow: 0 0 8px rgba(136,153,204,0.5);
    text-transform: uppercase;
}

/* =============================================
   TERRARIA MENU
   Positions derived from erased text bounding boxes
   in the 1366×768 image:
     "Single Player" center y=283 (36.9%)
     spacing ~53px = ~6.9% per item
   ============================================= */

.tr-menu {
    position: absolute;
    top: 33.5%;          /* puts first item center at ~36.9% */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tr-item {
    font-family: var(--font-menu);
    font-weight: 700;
    font-size: clamp(18px, 3.4vh, 32px);
    color: #c8d8f0;
    text-decoration: none;
    cursor: pointer;
    padding: 1.65vh 24px;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 4px rgba(0,0,20,0.9);
    transition: color 0.1s, text-shadow 0.1s, transform 0.1s;
    user-select: none;
    display: block;
    line-height: 1;
}

.tr-item:hover {
    color: #ffffff;
    text-shadow:
        2px 2px 4px rgba(0,0,20,0.9),
        0 0 14px rgba(255,255,255,0.95),
        0 0 36px rgba(200,220,255,0.65);
    transform: scale(1.07);
}

.tr-exit {
    color: #9aadce;
    font-size: clamp(15px, 2.8vh, 26px);
}

.tr-exit:hover {
    color: #ffdd88;
    text-shadow:
        2px 2px 4px rgba(0,0,20,0.9),
        0 0 14px rgba(255,220,100,0.95),
        0 0 36px rgba(255,190,50,0.55);
}

.resume-notice {
    display: block;
    font-family: var(--font-body);
    font-size: 12px;
    color: #9aaabf;
    letter-spacing: 1px;
    text-align: center;
    margin-top: 4px;
    pointer-events: none;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
    opacity: 0.85;
}

/* =============================================
   SOCIAL + VERSION
   Matches game: version bottom-left ~y=750 (97.7%)
   ============================================= */

.social-row {
    position: absolute;
    bottom: 2.6%;
    right: 1.5%;
    display: flex;
    gap: 18px;
}

.tr-social {
    font-family: var(--font-menu);
    font-weight: 700;
    font-size: clamp(11px, 1.6vh, 15px);
    color: #c8d8f0;
    text-decoration: none;
    text-shadow: 1px 1px 0 #000;
    transition: color 0.12s, background 0.12s, text-shadow 0.12s;
    background: rgba(10, 15, 50, 0.75);
    border: 2px solid #4a5aaa;
    padding: 6px 14px;
}

.tr-social:hover {
    color: #fff;
    background: rgba(50, 70, 160, 0.85);
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

.version {
    position: absolute;
    bottom: 2.6%;
    left: 1%;
    font-family: var(--font-menu);
    font-weight: 600;
    font-size: clamp(11px, 1.6vh, 14px);
    color: #6878a8;
    text-shadow: 1px 1px 0 #000;
}

/* =============================================
   CONTENT SECTIONS
   ============================================= */

.content {
    position: relative;
    z-index: 10;
}

.tr-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    background: var(--section-bg);
    border-top: none;
}

/* Gradient fade at top and bottom of every section for smooth blending */
.tr-section::before,
.tr-section::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 180px;
    pointer-events: none;
    z-index: 2;
}

.tr-section::before {
    top: 0;
    background: linear-gradient(to bottom, #0a0e28 0%, transparent 100%);
}

.tr-section::after {
    bottom: 0;
    background: linear-gradient(to top, #0a0e28 0%, transparent 100%);
}

#about,
#projects,
#honors,
#experience,
#contact {
    overflow: hidden;
    background: #0a0e28;
}

#about-video,
#projects-video,
#honors-video,
#experience-video,
#contact-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    z-index: 0;
    pointer-events: none;
}


.section-inner {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 860px;
}

.tr-section-alt {
    background: var(--section-alt);
}

.section-title {
    font-family: var(--font-title);
    font-size: clamp(18px, 3.5vw, 28px);
    color: var(--tr-gold);
    text-shadow: 2px 2px 0 #6a4a00, 0 0 20px rgba(240,192,64,0.4);
    margin-bottom: 36px;
    letter-spacing: 3px;
}

/* =============================================
   PANELS
   ============================================= */

.tr-panel {
    background: var(--tr-panel-bg);
    border: 2px solid var(--tr-panel-border);
    box-shadow: inset 0 0 30px rgba(0,0,60,0.5), 0 4px 20px rgba(0,0,0,0.5);
    padding: 28px 32px;
    font-size: 16px;
    line-height: 1.65;
    color: #c8d8f0;
}

.tr-panel p + p { margin-top: 14px; }

.about-headline {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--tr-gold);
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    line-height: 1.7;
}

.skills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.skill-tag {
    font-family: var(--font-menu);
    font-weight: 700;
    font-size: 12px;
    color: #88ffaa;
    background: rgba(0, 80, 30, 0.5);
    border: 1px solid #2a7a4a;
    padding: 5px 10px;
    text-shadow: 0 0 8px rgba(80,255,120,0.5);
}

/* =============================================
   SECTION BUTTONS
   ============================================= */

.tr-btn {
    display: inline-block;
    font-family: var(--font-menu);
    font-weight: 700;
    font-size: 14px;
    color: #c8d8f0;
    background: rgba(20, 30, 90, 0.75);
    border: 2px solid var(--tr-panel-border);
    padding: 10px 20px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.12s, background 0.12s, text-shadow 0.12s;
    text-shadow: 1px 1px 0 #000;
}

.tr-btn:hover {
    color: #fff;
    background: rgba(50, 70, 160, 0.85);
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

.next-btn {
    margin-top: 20px;
    float: right;
}

.back-btn {
    margin-top: 28px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* =============================================
   PROJECT CARDS
   ============================================= */

.project-carousel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.project-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.proj-page-indicator {
    font-family: var(--font-menu);
    color: var(--tr-gold);
    font-size: 14px;
    letter-spacing: 2px;
    min-width: 40px;
    text-align: center;
}

.tr-card {
    background: var(--tr-panel-bg);
    border: 2px solid var(--tr-panel-border);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tr-card:hover {
    border-color: #8898e0;
    box-shadow: 0 0 20px rgba(100,120,220,0.3);
}

.tr-card h3 {
    font-family: var(--font-title);
    font-size: 18px;
    color: #e8f0ff;
    text-shadow: 0 0 12px rgba(160,180,255,0.4);
    letter-spacing: 0.5px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tr-panel-border);
}

.tr-card > p {
    font-size: 14px;
    color: #8898b8;
    line-height: 1.6;
    flex: 1;
}

.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =============================================
   HONORS
   ============================================= */

.honors-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.honor-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--tr-panel-bg);
    border: 2px solid var(--tr-panel-border);
    padding: 18px 24px;
    transition: border-color 0.15s;
    flex-wrap: wrap;
}

.honor-expandable {
    cursor: pointer;
    user-select: none;
}

.honor-chevron {
    font-size: 10px;
    display: inline-block;
    transition: transform 0.25s ease;
    margin-left: 6px;
    opacity: 0.7;
}

.honor-expandable[aria-expanded="true"] .honor-chevron {
    transform: rotate(180deg);
}

.honor-dropdown {
    display: none;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--tr-panel-border);
    font-family: var(--font-body);
    font-size: 14px;
    color: #9aaabf;
    line-height: 1.6;
    flex-basis: 100%;
}

.honor-expandable[aria-expanded="true"] .honor-dropdown {
    display: block;
    animation: dropdown-open 0.25s ease;
}

@keyframes dropdown-open {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.honor-video {
    margin-top: 14px;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border: 2px solid var(--tr-panel-border);
}

.honor-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.honor-item:hover {
    border-color: var(--tr-gold);
}

.honor-icon {
    font-size: 22px;
    color: var(--tr-gold);
    text-shadow: 0 0 12px rgba(240,192,64,0.7);
    flex-shrink: 0;
    line-height: 1;
}

.honor-info h3 {
    font-family: var(--font-title);
    font-size: 13px;
    color: #e0e8ff;
    margin-bottom: 6px;
}

.honor-info p {
    font-size: 15px;
    color: #7888b0;
    line-height: 1.5;
}

/* =============================================
   TIMELINE
   ============================================= */

.timeline {
    position: relative;
    padding-left: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #1e2a60;
}

.timeline-item { position: relative; }

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 20px;
    width: 14px;
    height: 14px;
    background: var(--tr-gold);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(240,192,64,0.7);
}

.timeline-content h3 {
    font-family: var(--font-title);
    font-size: 13px;
    color: var(--tr-gold);
    margin-bottom: 8px;
}

.timeline-role {
    font-size: 13px;
    color: #88aadd;
    margin-bottom: 4px;
    font-weight: 600;
}

.timeline-date {
    font-size: 12px;
    color: #556080;
    margin-bottom: 10px;
    font-weight: 600;
}

.timeline-content p:last-child {
    font-size: 15px;
    color: #9aaac0;
    line-height: 1.6;
}

.cert-subsection {
    margin-top: 32px;
    margin-left: 12px;
    padding: 16px 28px;
    border-left: 2px solid #2a3460;
    opacity: 0.7;
}

.cert-subsection-title {
    font-family: var(--font-menu);
    font-size: 11px;
    color: #556080;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.cert-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 13px;
    color: #6070a0;
    line-height: 1.6;
}

.honor-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(240,192,64,0.3);
    transition: border-color 0.15s;
}

.honor-link:hover {
    border-color: var(--tr-gold);
    color: var(--tr-gold);
}

/* =============================================
   CONTACT
   ============================================= */

.contact-panel { text-align: center; }

.contact-panel > p {
    font-size: 16px;
    color: #c8d8f0;
    margin-bottom: 28px;
    line-height: 1.6;
}

.contact-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 560px) {
    .logo-title  { font-size: 22px; letter-spacing: 2px; }
    .tr-item     { font-size: 22px; }
    .tr-exit     { font-size: 18px; }
    .social-row  { bottom: 52px; }

    .contact-links  { flex-direction: column; align-items: center; }
    .tr-section     { padding: 60px 16px; }

    .next-btn {
        float: none;
        display: block;
        margin: 16px auto 0;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tr-item { transition: none; }
    html     { scroll-behavior: auto; }
}
