/*
 * Aquest programa és programari lliure: pots redistribuir-lo i/o modificar-lo
 * sota els termes de la GNU General Public License (GPLv3).
*/

/* --- Variables & Dark Mode --- */
:root {
    --bg: #FDFDFD;  
    --text-main: #1A1C20; 
    --text-muted: #8B949E;
    --border: #E5E5E5;
    --card-hover: #FFFFFF;
    --accent: #000000;
    --bento-bg: #FFFFFF; 
    --bento-border: rgba(0,0,0,0.04);
    --toggle-bg: #E5E5E5;
    --shadow: rgba(0, 0, 0, 0.08);
    --connect-link-color: #000000;
    --selection-bg: #171717;
    --selection-text: #FAFAF9;
    --map-filter: brightness(1); /* Satellite optimized */
    
    /* Dot Matrix Colors (Subtle for Light Mode) */
    --dot-color-1: #e5e5e5;
    --dot-color-2: #f0f0f0;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0a0a; 
        --text-main: #ededed;
        --text-muted: #a1a1a1;
        --border: #2a2a2a;
        --card-hover: #1a1a1a;
        --accent: #ededed;
        --bento-bg: #161616;
        --bento-border: rgba(255,255,255,0.08);
        --toggle-bg: #2a2a2a;
        --shadow: rgba(0,0,0,0.5);
        --connect-link-color: #ededed;
        --selection-bg: #ededed;
        --selection-text: #111111;
        --map-filter: brightness(0.8); 
        /* UPDATED: Dot Matrix Colors from your snippet */
        --dot-color-1: #222222;
        --dot-color-2: #111111;
    }
}
body:has(.theme-toggle-btn:checked) {
    /* UPDATED: Matches the specific hex codes requested */
    --bg: #0a0a0a; 
    --text-main: #ededed;
    --text-muted: #a1a1a1;
    --border: #2a2a2a;
    --card-hover: #1a1a1a;
    --accent: #ededed;
    --bento-bg: #161616;
    --bento-border: rgba(255,255,255,0.08);
    --toggle-bg: #2a2a2a;
    --shadow: rgba(0,0,0,0.5);
    --connect-link-color: #ededed;
    --selection-bg: #ededed;
    --selection-text: #111111;
    --map-filter: brightness(0.8); 
    
    /* UPDATED: Dot Matrix Colors from your snippet */
    --dot-color-1: #222222;
    --dot-color-2: #111111;
}

/* --- Base $ Typo --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
::selection { background: var(--selection-bg); color: var(--selection-text); }
body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
h1 {
    font-family: monospace, sans-serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}
p { margin-bottom: 16px; font-size: 16px; color: var(--text-main); opacity: 0.9; }
.highlight { 
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 3px;
    color: var(--text-main);
}
/* --- Toggle LightDark --- */
.theme-toggle-btn {
    --size: 20px;
    position: fixed;
    top: 24px; right: 24px;
    border: none;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 18px;
    z-index: 1000;
    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: inset calc(var(--size) * 0.33) calc(var(--size) * -0.25) 0;
    view-transition-name: theme-toggle;
    appearance: none;
}
.theme-toggle-btn:checked {
  --ray-size: calc(var(--size) * -0.4);
  --offset-orthogonal: calc(var(--size) * 0.65);
  --offset-diagonal: calc(var(--size) * 0.45);
  transform: scale(0.75);
  color: hsl(40, 100%, 50%);
  box-shadow: 
    inset 0 0 0 var(--size),
    calc(var(--offset-orthogonal) * -1) 0 0 var(--ray-size),
    var(--offset-orthogonal) 0 0 var(--ray-size),
    0 calc(var(--offset-orthogonal) * -1) 0 var(--ray-size),
    0 var(--offset-orthogonal) 0 var(--ray-size),
    calc(var(--offset-diagonal) * -1) calc(var(--offset-diagonal) * -1) 0 var(--ray-size),
    var(--offset-diagonal) var(--offset-diagonal) 0 var(--ray-size),
    calc(var(--offset-diagonal) * -1) var(--offset-diagonal) 0 var(--ray-size),
    var(--offset-diagonal) calc(var(--offset-diagonal) * -1) 0 var(--ray-size);
}
.theme-toggle-btn:hover { transform: rotate(15deg) scale(1.1); }

/* --- Sections --- */
.wrapper {
    max-width: 1050px;
    margin: 0 auto;
    padding: 80px 24px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 80px;
}

/* --- Profile --- */
.profile-section {
    position: sticky;
    top: 80px;
    height: fit-content;
    text-align: center;
}
.avatar-container {
    perspective: 1000px;
    transform-style: preserve-3d;
    width: 100%;
    height: 300px;
    margin-bottom: 24px;
    cursor: pointer;
    position: relative;
    z-index: 10; 
}
.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    border-radius: 12px;
    filter: none; 
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
    transition: transform 0.1s ease-out, box-shadow 0.4s ease;
    will-change: transform;
}
.avatar-description {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 16px;
}

/* --- Contact --- */
.contact-button {
    font-family: monospace, sans-serif;
    font-size: 13px;
    background: var(--bento-bg);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    font-variant-numeric: tabular-nums;
    cursor: default;
    min-width: 180px;
    justify-content: center;
    box-shadow: 0 2px 5px var(--shadow);
}
.contact-toggle {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 0.5ch;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s;
}
.contact-toggle:hover {
  color: var(--connect-link-color);
}
.contact-toggle input {
  display: none; 
}
/* Mail text style */
.contact-toggle span {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  margin-left: 0;
  font-weight: normal;
  font-family: monospace, sans-serif;
  color: var(--text-main);
  transition: all 0.4s ease-in-out;
}
.contact-toggle input:checked ~ span {
  max-width: 300px;
  opacity: 1;
  margin-left: 10px;
}

/* --- Social & Comment--- */
.social-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 24px;
}
.social-links a {
    color: var(--text-main);
    font-size: 20px;
    transition: transform 0.3s, color 0.3s;
}
.social-links a:hover { 
    transform: translateY(-4px); 
    color: var(--text-muted); 
}
.comment-wrapper {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 10px;
    display: flex;
    justify-content: center;
}
.comment {
    font-family: monospace, sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Content --- */
.section-header {
    font-family: monospace, sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    margin-bottom: 24px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-header::after {
    content: "";
    height: 1px;
    flex-grow: 1;
    background: var(--border);
}
.block {
    margin-bottom: 60px;
}

/* --- Box --- */
.box-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.box {
    background: var(--bento-bg);
    border: 1px solid var(--bento-border);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow);
    display: flex;
    flex-direction: column;
}
.box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -6px var(--shadow);
    border-color: var(--border);
    z-index: 2;
}
.box-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace, sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    z-index: 5;
}
.box-1 {
    grid-column: 1 / 2;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.box-2 {
    grid-column: 2 / 3;
    height: 180px;
    padding: 0;
    position: relative;
    overflow: hidden;
    display: block; 
}
.box-3 {
    grid-column: 1 / 3;
    height: 200px;
    display: flex;
    flex-direction: column;
}
.box-link {
    position: absolute; inset: 0; z-index: 10;
}

/* --- Project Status --- */
.status {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 44px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}
.status-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}
.status-header {
    font-family: monospace, sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-main);
}
.status-description {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'Inter', monospace;
    opacity: 0.8;
}
.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.05);
    padding: 4px 8px;
    border-radius: 4px;
}
#badge-description {
    font-family: monospace, sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}
.pulsing-dot-true {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.pulsing-dot-false {
    width: 6px;
    height: 6px;
    background-color: #b91610;
    border-radius: 50%;
    animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(185, 22, 16, 0.7); }
    70% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.pulsing-dot-standby {
    width: 6px;
    height: 6px;
    background-color: #f3c034;
    border-radius: 50%;
    animation: pulse-yellow 2s infinite;
}
@keyframes pulse-yellow {
    0% { box-shadow: 0 0 0 0 rgba(202, 118, 7, 0.7); }
    70% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --- Timeline --- */
.timeline-item {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    margin-left: -16px; margin-right: -16px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    cursor: default;
}
.timeline-item:hover {
    background-color: var(--card-hover);
    box-shadow: 0 4px 12px var(--shadow);
    transform: scale(1.01);
}
.tl-left h3 {
    font-family: monospace, sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
}
.tl-desc {
    font-size: 14px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
    max-width: 420px;
    line-height: 1.5;
}
.tl-right {
    font-size: 13px;
    font-family: monospace, sans-serif;
    color: var(--text-muted);
    white-space: nowrap;
    padding-left: 20px;
}

/* --- Footer --- */
.footer {
    margin-top: 80px;
    color: var(--text-muted);
    font-size: 13px;
    font-family: monospace, sans-serif;
    opacity: 0.6;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

/* --- Components --- */
.funny-note {
    font-size: 12px;
    margin-bottom: 0;
    opacity: 0.8;
}
.status-dot {
    width: 10px; 
    height: 10px;
    background-color: #10b981; 
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: breathing 2s infinite ease-in-out;
}
@keyframes breathing {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .wrapper { grid-template-columns: 1fr; gap: 50px; padding: 60px 20px; }
    .profile-section { position: relative; top: 0; text-align: center; }
    .avatar-container { width: 200px; height: 200px; margin: 0 auto 24px auto; } 
    .social-links { justify-content: center; }
    .live-age-badge { margin: 0 auto 12px auto; }
    .timeline-item { flex-direction: column; }
    .tl-right { text-align: left; padding-left: 0; margin-top: 6px; }
    .theme-toggle-btn { top: 15px; right: 15px; width: 40px; height: 40px; }
    .connect-link { font-size: 22px; }
    .connect-link .x-icon { font-size: 20px; }
    .footer { text-align: center; margin-bottom: 40px; }
    .preloader-text { font-size: 40px; }
    .new-bento-grid {
        grid-template-columns: 1fr;
    }
    .box-1 { grid-column: 1 / 2; }
    .box-2 { grid-column: 1 / 2; height: 200px; }
    .box-3 { grid-column: 1 / 2; height: 160px; }
}