/* =========================================================================
   Meinicke.dev — general.css
   Shared core styles for Meinicke.dev
   Theme: Dark
   ========================================================================= */

/* --- Theme tokens ------------------------------------------------------- */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);

    --bg:        #050505;
    --bg-1:      #0e0e0e;
    --bg-2:      #161616;
    --surface:   #161616;
    --surface-2: #222222;
    --border:       #222222;
    --border-strong:#2a2a2a;

    --text-main:  #f4f4f5;
    --text-muted: #a1a1aa;
    --text-dim:   #71717a;

    --accent:        #facc15;
    --accent-bright: #fde047;
    --accent-hover:  #eab308;
    --accent-soft:   rgba(250, 204, 21, 0.14);
    --accent-line:   rgba(250, 204, 21, 0.5);
    --accent-glow:   rgba(250, 204, 21, 0.25);

    --cyan:  #22d3ee;
    --green: #22c55e;
    --red:   #ef4444;

    /* Text color on top of the yellow footer section */
    --on-accent: #0a0a0a;

    --row-hover:   rgba(255, 255, 255, 0.02);
    --row-hover-2: rgba(255, 255, 255, 0.04);

    --cursor-blend: difference;
    --nav-blend:    difference;
    --glow:         0 0 20px var(--accent-glow);
    --img-hover-shadow-color: rgba(0, 0, 0, 0.5);

    --shadow-soft:   0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-strong: 0 20px 40px rgba(0, 0, 0, 0.6);

    --approach-text: #0a0a0a;
}

/* --- Base --------------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}
::selection { background-color: var(--accent); color: #0a0a0a; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Custom cursor ------------------------------------------------------ */
.custom-cursor {
    position: fixed; top: 0; left: 0;
    width: 20px; height: 20px; border-radius: 50%;
    background-color: var(--accent);
    pointer-events: none; mix-blend-mode: var(--cursor-blend);
    transform: translate(-50%, -50%); z-index: 10000;
    transition: width 0.3s, height 0.3s, background-color 0.3s;
}
.custom-cursor.hovering { width: 60px; height: 60px; background-color: var(--accent-soft); backdrop-filter: blur(2px); }
@media (hover: none) { * { cursor: auto; } .custom-cursor { display: none; } input, textarea { cursor: text; } }

/* --- Navbar (shared brand markup) --------------------------------------- */
nav {
    position: fixed; top: 0; width: 100%;
    padding: 24px 8vw;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100;
    mix-blend-mode: var(--nav-blend);
}
.navbar-brand {
    font-weight: 800; font-size: 1.5rem;
    text-decoration: none; letter-spacing: -1px;
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--accent-color, var(--accent));
}
.navbar-brand .brand-suffix {
    color: #f4f4f5;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}
.navbar-brand .brand-logo { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
    color: #f4f4f5;
    text-decoration: none; font-size: 0.9rem; font-weight: 500; position: relative;
}
.nav-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 1px; background: currentColor; transition: 0.3s;
}
.nav-links a:hover::after { width: 100%; }

/* --- Shared typography -------------------------------------------------- */
.title-huge {
    font-size: clamp(3rem, 8vw, 7rem); font-weight: 900; line-height: 1;
    letter-spacing: -0.03em; text-transform: uppercase;
    text-shadow: var(--glow);
}

.title-section {
    font-size: clamp(2rem, 5vw, 4rem); font-weight: 800;
    margin-bottom: 2rem; letter-spacing: -0.02em;
    text-shadow: 0 0 15px var(--accent-glow);
}

.subtitle-section { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 4rem; }
.text-accent  { color: var(--accent-color, var(--accent)); }
.text-yellow  { color: var(--accent); }
.text-glow { text-shadow: 0 0 8px rgba(255, 255, 255, 0.3); }
.section-padding { padding: 120px 8vw; }

/* --- Buttons ----------------------------------------------------------- */
.btn-modern {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 16px 32px; background: transparent; color: var(--text-main);
    border: 1px solid var(--border-strong); border-radius: 100px;
    font-size: 1rem; font-weight: 500; text-decoration: none;
    transition: var(--transition-smooth); position: relative; overflow: hidden;
}
.btn-modern::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--text-main); transform: translateY(100%);
    transition: var(--transition-smooth); z-index: -1; border-radius: 100px;
}
.btn-modern:hover { color: var(--bg); border-color: var(--text-main); }
.btn-modern:hover::before { transform: translateY(0); }
.btn-modern.primary { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.btn-modern.primary::before { background: var(--text-main); }
.btn-modern.primary:hover { color: #f4f4f5; }

.btn-ghost {
    background: transparent; border: none; color: var(--text-muted);
    font-family: var(--font-mono); font-size: 0.85rem;
    transition: 0.3s; cursor: none; padding: 8px 4px;
}
.btn-ghost.active { color: var(--accent); }
.btn-ghost:hover { color: var(--text-main); }

/* --- Modal ------------------------------------------------------------- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9998;
    display: none; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: var(--surface); padding: 40px; border-radius: 24px;
    width: 100%; max-width: 400px;
    display: flex; flex-direction: column; gap: 20px; position: relative;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-strong);
}
.modal-close {
    position: absolute; top: 15px; right: 15px;
    background: none; border: none; color: var(--text-muted); cursor: none;
}
.modal-title { font-size: 1.5rem; font-weight: 700; }
.form-input {
    width: 100%; padding: 12px 16px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-main);
    font-family: var(--font-sans); font-size: 1rem;
    outline: none; transition: border-color 0.3s; cursor: none;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-dim); }
textarea.form-input { resize: vertical; min-height: 80px; }

/* --- Tooltip (shared hover) -------------------------------------------- */
.tooltip-box {
    position: fixed; background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px;
    padding: 12px; font-size: 0.85rem; pointer-events: none;
    z-index: 9999; opacity: 0; transition: opacity 0.2s;
    box-shadow: var(--shadow-soft); min-width: 180px;
    color: var(--text-main);
}
.tooltip-box.visible { opacity: 1; }
.tooltip-title { color: var(--text-main); font-weight: 600; margin-bottom: 5px; }
.tooltip-sub   { color: var(--text-muted); font-size: 0.8rem; }
.tooltip-proj  { color: var(--accent); margin-top: 5px; font-family: var(--font-mono); font-size: 0.8rem; }

/* --- Animations -------------------------------------------------------- */
.fade-up { opacity: 0; transform: translateY(40px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.fade-up.visible { opacity: 1; transform: translateY(0); }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }
.floating { animation: float 6s ease-in-out infinite; }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* --- Toast (used by popup.js) ------------------------------------------ */
#md-toast-container {
    position: fixed; bottom: 24px; right: 24px;
    display: flex; flex-direction: column; gap: 12px;
    z-index: 10001; pointer-events: none;
}
.md-toast {
    pointer-events: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: var(--shadow-soft);
    max-width: 380px;
    display: flex; align-items: flex-start; gap: 12px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.md-toast.visible { transform: translateX(0); }
.md-toast.exit { transform: translateX(120%); }
.md-toast-success { border-left-color: var(--green); }
.md-toast-error   { border-left-color: var(--red); }
.md-toast-warning { border-left-color: #eab308; }
.md-toast-info    { border-left-color: var(--accent); }
.md-toast-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.md-toast-success .md-toast-icon { color: var(--green); }
.md-toast-error .md-toast-icon   { color: var(--red); }
.md-toast-warning .md-toast-icon { color: #eab308; }
.md-toast-info .md-toast-icon    { color: var(--accent); }
.md-toast-body { flex: 1; min-width: 0; }
.md-toast-title { font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
.md-toast-msg   { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.md-toast-close {
    background: none; border: none; color: var(--text-dim);
    cursor: none; padding: 2px; margin-left: 4px;
}
.md-toast-close:hover { color: var(--text-main); }

/* --- Popup (used by popup.js) ------------------------------------------ */
.md-popup-overlay {
    position: fixed; inset: 0;
    background: rgba(5, 5, 5, 0.72);
    backdrop-filter: blur(6px);
    z-index: 9998;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    opacity: 0; transition: opacity 0.2s ease;
}
.md-popup-overlay.active { opacity: 1; }
.md-popup {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-strong);
    width: 100%; max-width: 420px;
    overflow: hidden;
    transform: scale(0.95); opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.md-popup.active { transform: scale(1); opacity: 1; }
.md-popup-head { padding: 32px 28px 20px 28px; text-align: center; }
.md-popup-icon {
    width: 56px; height: 56px; border-radius: 50%;
    display: grid; place-items: center; margin: 0 auto 18px auto;
}
.md-popup-icon i { width: 28px; height: 28px; }
.md-popup-title { font-size: 1.25rem; font-weight: 700; color: var(--text-main); margin-bottom: 6px; }
.md-popup-msg { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.md-popup-actions { padding: 0 28px 28px 28px; display: flex; gap: 12px; }
.md-popup-btn {
    flex: 1; padding: 12px 16px; border-radius: 12px;
    font-weight: 600; font-size: 0.9rem; cursor: none;
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-main); transition: all 0.2s ease;
}
.md-popup-btn:hover { border-color: var(--text-muted); }
.md-popup-btn-primary { color: #fff; border: none; }

/* Popup accent types */
.md-popup-type-danger  .md-popup-icon { background: rgba(220, 38, 38, 0.12); color: var(--red); }
.md-popup-type-danger  .md-popup-btn-primary { background: var(--red); }
.md-popup-type-warning .md-popup-icon { background: rgba(234, 179, 8, 0.14); color: #eab308; }
.md-popup-type-warning .md-popup-btn-primary { background: #eab308; color: #0a0a0a; }
.md-popup-type-success .md-popup-icon { background: rgba(22, 163, 74, 0.14); color: var(--green); }
.md-popup-type-success .md-popup-btn-primary { background: var(--green); }
.md-popup-type-info    .md-popup-icon { background: var(--accent-soft); color: var(--accent); }
.md-popup-type-info    .md-popup-btn-primary { background: var(--accent); color: #0a0a0a; }

/* --- Mobile ------------------------------------------------------------ */
@media (max-width: 968px) {
    .nav-links { display: none; }
}
