@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@400;600;700&display=swap');

:root {
    --bg-primary: #010409; /* Deep black */
    --bg-secondary: #0d1117; /* Midnight blue */
    --surface: rgba(22, 27, 34, 0.8);
    --accent: #00E5FF; /* Electric Cyan */
    --accent-glow: rgba(0, 229, 255, 0.4);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(1, 4, 9, 0.8);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(0, 229, 255, 0.05) 1px, transparent 0);
    background-size: 40px 40px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 18px; /* Increased base font size */
    line-height: 1.8; /* Better readability */
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 800; /* Extra bold */
    line-height: 1.2;
}

h1 { font-size: clamp(3rem, 8vw, 5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: 1.75rem; }

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 1000;
    padding: 15px 50px;
    background: transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

header.scrolled {
    padding: 10px 50px;
    background: rgba(1, 4, 9, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}

.nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 100%;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    justify-self: start;
}

.logo img {
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
    justify-self: center;
}

.nav-cta {
    display: flex;
    align-items: center;
    justify-self: end;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent);
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 50px;
    color: var(--accent);
    box-shadow: 0px 0px 15px var(--accent-glow);
    padding: 8px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0; /* Ensures no displacement */
}

.btn-primary:hover {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0px 0px 25px var(--accent);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-primary);
    padding: 12px 30px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-secondary);
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem 0;
    z-index: 100;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

.dropdown-content a {
    padding: 0.75rem 1.5rem;
    display: block;
    color: var(--text-secondary);
}

.dropdown-content a:hover {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 150px 0 60px 0; /* Increased top padding to avoid header overlap */
}

.hero::before {
    content: '';
    position: absolute;
    top: 20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: -1;
    filter: blur(60px);
}

.hero-content {
    max-width: 800px;
    margin-bottom: 40px; /* Space between title and following block */
}

.hero-visual-container {
    margin-top: 5rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.browser-mockup {
    width: 100%;
    max-width: 1000px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 40px 100px rgba(0,0,0,0.6);
    overflow: hidden;
    position: relative;
}

.browser-header {
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.dots {
    display: flex;
    gap: 8px;
}

.dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dots span:nth-child(1) { background: #ff5f56; }
.dots span:nth-child(2) { background: #ffbd2e; }
.dots span:nth-child(3) { background: #27c93f; }

.browser-mockup img {
    width: 100%;
    display: block;
}

.hero-tag {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--accent-glow);
    border-radius: 50px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2.5rem; /* Increased margin for better separation */
    box-shadow: 0 0 15px var(--accent-glow);
}

.hero h1 {
    line-height: 1.1;
    margin-bottom: 2rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin: 0 auto 3rem auto;
    max-width: 800px;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Services Section */
.section {
    padding: 10rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 6rem;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    padding: 3rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0px 0px 20px var(--accent-glow);
}

.service-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 12px;
    margin-bottom: 2rem;
    color: var(--accent);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn-text {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-text:hover {
    gap: 0.75rem;
}

/* Tesis Section */
.tesis-section {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.tesis-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 5rem;
}

.tesis-content h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.tesis-badge {
    background: #f59e0b; /* Amber for specialized look */
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: inline-block;
}

.tesis-features {
    list-style: none;
    margin-top: 2rem;
}

.tesis-features li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.tesis-features i {
    color: var(--accent);
}

.tesis-note {
    margin-top: 3rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--accent);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tesis-formal-section {
    margin-top: 20px !important;
    padding-top: 0px !important;
}

/* Bento Portfolio */
.bento-portfolio {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: 250px;
    gap: 1.5rem;
    padding: 2rem 0;
}

.bento-card {
    background: linear-gradient(145deg, rgba(22, 27, 34, 0.8), rgba(13, 17, 23, 0.9));
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.bento-card.wide {
    grid-column: span 2;
}

.bento-card.tall {
    grid-row: span 2;
}

.bento-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 10px 40px rgba(0, 229, 255, 0.25);
}

.bento-card .card-icon {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--accent);
    opacity: 0.8;
}

.bento-card .card-icon i {
    width: 48px;
    height: 48px;
}

.bento-card .card-content {
    z-index: 2;
}

.bento-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem; /* Increased for better separation */
    color: #fff;
    line-height: 1.2;
}

.bento-card p {
    font-size: 1rem; /* Slightly larger for readability */
    color: var(--text-secondary);
    margin-bottom: 0;
    max-width: 90%;
}

.capsule-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem; /* Space between tags and title */
}

.tag {
    padding: 4px 12px;
    border-radius: 50px;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.bento-item {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
}

.placeholder-visual {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: 2rem;
    text-align: center;
    gap: 1.5rem;
}

.placeholder-visual i {
    width: 60px;
    height: 60px;
    color: var(--accent);
}

.placeholder-visual h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.portfolio-item {
    transition: all 0.5s ease;
}

.portfolio-item.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.8);
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    opacity: 0.6;
}

.bento-item:hover img {
    transform: scale(1.1);
    opacity: 0.4;
}

.bento-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    transform: translateY(20px);
    opacity: 0;
    transition: var(--transition);
}

.bento-item:hover .bento-info {
    transform: translateY(0);
    opacity: 1;
}

.large { grid-column: span 2; grid-row: span 2; }
.medium { grid-column: span 2; }

/* Footer */
footer {
    padding: 5rem 0;
    border-top: 1px solid var(--glass-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand p {
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.footer-links h4 {
    margin-bottom: 2rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: 1s all ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 992px) {
    .tesis-card { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .bento-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
    .large, .medium { grid-column: span 2; height: 300px; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 3rem; }
    .footer-grid { grid-template-columns: 1fr; }
}
