/* ===== General Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* ===== Layout ===== */
body {
    font-family: 'Times New Roman', Times, serif;
    overflow-x: hidden;
    color: #2a2a2a;
    background: #f8f4f1;
    min-height: 100vh;
    cursor: none;
    transition: background-color 0.6s ease;
}

/* ===== Custom Cursor ===== */
.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background: #4E8BC4;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, margin 0.3s ease;
}

.cursor-dot.on-section {
    width: 20px;
    height: 20px;
    background: rgba(78, 139, 196, 0.35);
}

.cursor-cross {
    position: fixed;
    width: 32px;
    height: 32px;
    pointer-events: none;
    z-index: 9997;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
    opacity: 0.4;
}

.cursor-cross::before,
.cursor-cross::after {
    content: '';
    position: absolute;
    background: #4E8BC4;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.cursor-cross::before {
    width: 1.5px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.cursor-cross::after {
    width: 100%;
    height: 1.5px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.cursor-cross.hover {
    width: 48px;
    height: 48px;
    opacity: 0.7;
}

.cursor-cross.hover::before,
.cursor-cross.hover::after {
    background: #96CBFC;
}

/* Hide crosshair on sections, show bigger dot only */
.cursor-cross.on-section {
    opacity: 0;
}

/* ===== Scroll Progress Bar ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF99BE, #96CBFC, #4E8BC4);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s linear;
}

/* ===== Background Canvas ===== */
#contactCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 30px;
    right: 40px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 1000;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-list li a {
    text-decoration: none;
    color: #4E8BC4;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    position: relative;
    transition: color 0.3s;
    cursor: none;
}

.nav-list li a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #4E8BC4;
    transition: width 0.3s ease;
}

.nav-list li a:hover {
    color: #FF99BE;
}

.nav-list li a:hover::after {
    width: 100%;
    background: #FF99BE;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 28px;
    color: #4E8BC4;
    z-index: 1001;
}

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.hero-title {
    font-size: 80px;
    font-weight: bold;
    color: #4E8BC4;
    letter-spacing: 4px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1.2s ease forwards 0.3s;
}

.typewriter-line {
    margin-top: 24px;
    font-size: 20px;
    color: rgba(78, 139, 196, 0.6);
    min-height: 32px;
    text-align: center;
    letter-spacing: 1px;
    font-style: italic;
    opacity: 0;
    animation: fadeUp 1.2s ease forwards 0.8s;
}

.typewriter-line .cursor {
    display: inline-block;
    width: 1.5px;
    height: 20px;
    background: #4E8BC4;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    color: #4E8BC4;
    animation: bounce 2s infinite;
    transition: opacity 0.3s ease;
    cursor: none;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-15px); }
    60% { transform: translateX(-50%) translateY(-8px); }
}

/* ===== Section Styling ===== */
.section-header {
    margin-bottom: 50px;
}

.section-label {
    font-size: 12px;
    color: #FF99BE;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.section-title {
    font-size: 48px;
    font-weight: bold;
    color: #4E8BC4;
    letter-spacing: 2px;
}

/* ===== Contact Info Section ===== */
.contact-info-section {
    padding: 100px 60px;
    position: relative;
    z-index: 10;
    text-align: center;
}

.info-row {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.info-tile {
    flex: 1;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(78, 139, 196, 0.1);
    border-radius: 16px;
    padding: 40px 28px 36px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: none;
    opacity: 0;
    transform: translateY(40px);
}

.info-tile.visible {
    opacity: 1;
    transform: translateY(0);
}

.info-tile:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(78, 139, 196, 0.2);
}

/* Make entire tile clickable for link tiles */
.info-tile.clickable {
    cursor: none;
}

.info-tile .tile-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: none;
}

.info-tile .tile-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #FF99BE, #96CBFC);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.info-tile:hover .tile-line {
    transform: scaleX(1);
}

.info-tile .tile-label {
    font-size: 11px;
    color: #FF99BE;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 14px;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.info-tile .tile-value {
    font-size: 17px;
    color: #3a3a3a;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
    word-break: break-word;
    cursor: none;
    position: relative;
    z-index: 1;
}

.info-tile:hover .tile-value {
    color: #4E8BC4;
}

/* ===== Message Builder Section ===== */
.message-builder-section {
    padding: 60px 60px 120px;
    position: relative;
    z-index: 10;
}

.builder-container {
    max-width: 1200px;
    margin: 0 auto;
}

.builder-wrapper {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(78, 139, 196, 0.1);
    border-radius: 20px;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.builder-wrapper .corner-accent {
    position: absolute;
    width: 60px;
    height: 60px;
    border-color: rgba(78, 139, 196, 0.15);
    border-style: solid;
}

.corner-accent.tl { top: 16px; left: 16px; border-width: 1.5px 0 0 1.5px; }
.corner-accent.tr { top: 16px; right: 16px; border-width: 1.5px 1.5px 0 0; }
.corner-accent.bl { bottom: 16px; left: 16px; border-width: 0 0 1.5px 1.5px; }
.corner-accent.br { bottom: 16px; right: 16px; border-width: 0 1.5px 1.5px 0; }

.builder-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(78, 139, 196, 0.1);
}

.builder-top .section-header { margin-bottom: 0; }

.builder-top .builder-hint {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

.builder-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    align-items: start;
}

/* Topic Pool */
.topic-pool {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.topic-pool.visible { opacity: 1; transform: translateX(0); }

.topic-pool h4 {
    font-size: 11px;
    color: #999;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 18px;
    font-weight: bold;
}

.topic-chip {
    display: inline-block;
    background: rgba(78, 139, 196, 0.06);
    border: 1px solid rgba(78, 139, 196, 0.15);
    border-radius: 6px;
    padding: 10px 16px;
    margin: 4px;
    font-size: 14px;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
    color: #4E8BC4;
    cursor: grab;
    transition: all 0.25s ease;
    user-select: none;
}

.topic-chip:hover {
    background: rgba(78, 139, 196, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(78, 139, 196, 0.1);
    border-color: rgba(78, 139, 196, 0.3);
}

.topic-chip:active { cursor: grabbing; transform: scale(0.96); }

/* Compose Area */
.message-compose {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) 0.15s;
}

.message-compose.visible { opacity: 1; transform: translateX(0); }

.message-compose h4 {
    font-size: 11px;
    color: #999;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 18px;
    font-weight: bold;
}

.drop-zone {
    border: 1.5px dashed rgba(78, 139, 196, 0.2);
    border-radius: 8px;
    padding: 14px;
    min-height: 50px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 16px;
}

.drop-zone.drag-over {
    background: rgba(78, 139, 196, 0.04);
    border-color: #FF99BE;
}

.drop-zone .placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #c0c0c0;
    font-size: 13px;
    font-style: italic;
    pointer-events: none;
}

.dropped-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #4E8BC4;
    color: white;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
    animation: chipDrop 0.3s ease;
}

.dropped-chip .remove-chip {
    cursor: pointer;
    opacity: 0.6;
    font-size: 14px;
    transition: opacity 0.2s;
}

.dropped-chip .remove-chip:hover { opacity: 1; }

@keyframes chipDrop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.compose-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.compose-fields input,
.message-compose textarea {
    width: 100%;
    border: 1px solid rgba(78, 139, 196, 0.15);
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: 'Times New Roman', Times, serif;
    color: #2a2a2a;
    outline: none;
    transition: border 0.3s, background 0.3s;
    cursor: none;
}

.compose-fields input:focus,
.message-compose textarea:focus {
    border-color: #4E8BC4;
    background: rgba(255, 255, 255, 0.85);
}

.message-compose textarea {
    margin-bottom: 12px;
    resize: vertical;
    min-height: 80px;
}

.send-builder-btn {
    width: 100%;
    background: #4E8BC4;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 14px;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
    cursor: none;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.send-builder-btn:hover:not(:disabled) {
    background: #3a7ab5;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(78, 139, 196, 0.2);
}

.send-builder-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Response Message ===== */
.response-message {
    margin-top: 12px;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
    font-size: 14px;
}

.response-message.success { background: rgba(212, 237, 218, 0.8); color: #155724; }
.response-message.error { background: rgba(248, 215, 218, 0.8); color: #721c24; }
.response-message.show { opacity: 1; transform: translateY(0); }

/* ===== Fun Fact Widget ===== */
.funfact-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 900;
}

.funfact-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #4E8BC4;
    border: none;
    color: white;
    cursor: none;
    box-shadow: 0 4px 16px rgba(78, 139, 196, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    font-size: 18px;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
    font-style: italic;
}

.funfact-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 24px rgba(78, 139, 196, 0.4);
}

.funfact-toggle .btn-label {
    position: absolute;
    right: 58px;
    background: white;
    color: #4E8BC4;
    font-size: 13px;
    font-weight: bold;
    font-family: 'Times New Roman', Times, serif;
    font-style: normal;
    padding: 6px 14px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.funfact-toggle:hover .btn-label {
    opacity: 1;
    transform: translateX(0);
}

.funfact-widget.open .funfact-toggle .btn-label { display: none; }

/* Fun Fact Panel */
.funfact-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.funfact-widget.open .funfact-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.funfact-inner {
    padding: 28px 24px;
    text-align: center;
}

/* Dice area */
.dice-area {
    margin-bottom: 22px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dice {
    width: 64px;
    height: 64px;
    background: rgba(78, 139, 196, 0.08);
    border: 1.5px solid rgba(78, 139, 196, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: #4E8BC4;
    font-family: 'Times New Roman', Times, serif;
    transition: all 0.3s ease;
    position: relative;
}

.dice.rolling {
    animation: diceRoll 0.6s ease;
}

@keyframes diceRoll {
    0% { transform: rotate(0deg) scale(1); }
    20% { transform: rotate(72deg) scale(0.85); border-color: #FF99BE; }
    40% { transform: rotate(144deg) scale(1.1); }
    60% { transform: rotate(216deg) scale(0.9); border-color: #96CBFC; }
    80% { transform: rotate(288deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); border-color: rgba(78, 139, 196, 0.2); }
}

.dice-label {
    font-size: 11px;
    color: #bbb;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

/* Fact display */
.fact-display {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.fact-display p {
    font-size: 15px;
    line-height: 1.65;
    color: #3a3a3a;
    transition: all 0.35s ease;
}

.fact-display p.hidden {
    opacity: 0;
    transform: translateY(8px);
}

.fact-display .fact-placeholder {
    font-size: 14px;
    color: #ccc;
    font-style: italic;
}

/* Roll button */
.roll-btn {
    background: #4E8BC4;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 28px;
    font-size: 14px;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: none;
    transition: all 0.25s ease;
}

.roll-btn:hover:not(:disabled) {
    background: #3a7ab5;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(78, 139, 196, 0.2);
}

.roll-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Footer ===== */
.site-footer {
    text-align: center;
    padding: 40px 20px 50px;
    color: #999;
    font-size: 13px;
    letter-spacing: 1.5px;
    position: relative;
    z-index: 10;
}

.footer-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #FF99BE, #4E8BC4);
    margin: 0 auto 24px;
    border-radius: 2px;
}

.footer-name { font-weight: bold; color: #4E8BC4; }
.footer-year { margin-top: 6px; font-size: 12px; opacity: 0.6; }

/* ===== Fade-in ===== */
.fade-in-element {
    opacity: 0;
    transform: translateY(60px);
    transition: all 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.fade-in-element.visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero-title { font-size: 56px; }
    .info-row { flex-wrap: wrap; }
    .info-tile { flex: 1 1 calc(50% - 10px); }
    .builder-layout { grid-template-columns: 1fr; }
    .contact-info-section, .message-builder-section { padding-left: 40px; padding-right: 40px; }
    .builder-wrapper { padding: 36px; }
}

@media (max-width: 768px) {
    body { cursor: auto; }
    .cursor-dot, .cursor-cross { display: none; }
    * { cursor: auto !important; }

    .navbar { top: 20px; right: 20px; }
    .menu-toggle { display: block; position: fixed; }

    .nav-list {
        position: fixed; top: 70px; right: 20px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        border-radius: 16px;
        padding: 20px 28px;
        display: none;
        box-shadow: 0 10px 30px rgba(78, 139, 196, 0.2);
        border: 1px solid rgba(150, 203, 252, 0.3);
    }

    .nav-list.active { display: flex; animation: slideInNav 0.3s ease; }

    @keyframes slideInNav {
        from { opacity: 0; transform: translateY(-15px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .nav-list li a { font-size: 16px; }
    .hero-title { font-size: 40px; letter-spacing: 2px; }
    .typewriter-line { font-size: 16px; }
    .section-title { font-size: 34px; }

    .contact-info-section, .message-builder-section { padding: 60px 20px; }
    .info-row { flex-direction: column; }
    .info-tile { flex: 1 1 100%; }
    .compose-fields { grid-template-columns: 1fr; }
    .builder-wrapper { padding: 28px; }
    .builder-top { flex-direction: column; align-items: flex-start; gap: 8px; }

    .funfact-panel { width: 270px; right: -10px; }
    .funfact-toggle .btn-label { display: none; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 30px; }
    .section-title { font-size: 26px; }
    .navbar { top: 15px; right: 15px; }
    .contact-info-section, .message-builder-section { padding: 50px 15px; }
    .builder-wrapper { padding: 22px; }
    .corner-accent { width: 40px; height: 40px; }
    .funfact-widget { bottom: 18px; right: 18px; }
    .funfact-toggle { width: 44px; height: 44px; font-size: 16px; }
    .funfact-panel { width: calc(100vw - 30px); right: -10px; bottom: 56px; }
}