/* ============================================
   Homepage Styles - index.css
   ============================================ */

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header.scrolled {
    background-color: var(--bg-primary);
    box-shadow: 0 2px 20px var(--card-shadow);
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-mark {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.header:not(.scrolled) .logo-mark {
    color: var(--white);
}

.logo-subtext {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header:not(.scrolled) .logo-subtext {
    color: var(--silver);
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

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

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.header:not(.scrolled) .nav-links a {
    color: var(--silver);
}

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

.nav-cta {
    background-color: var(--teal);
    color: var(--white) !important;
    padding: 10px 20px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.nav-cta:hover {
    background-color: var(--teal-dark);
}

/* Theme Toggle - Minimal */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
    border: none;
    border-radius: 50%;
    background: transparent;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.theme-toggle:hover {
    opacity: 1;
}

.theme-toggle-icon {
    width: 18px;
    height: 18px;
    fill: var(--text-secondary);
    transition: fill 0.2s ease;
}

.header:not(.scrolled) .theme-toggle-icon {
    fill: var(--silver);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: transparent;
    border: none;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.header:not(.scrolled) .mobile-menu-toggle span {
    background: var(--white);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1E1E1E;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 30% 20%, #2D2D2D 0%, #1E1E1E 60%);
}

/* Animated molecular/network canvas */
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.75;
}

/* Gradient overlays for depth */
.hero-gradient-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(15, 35, 59, 0.6) 0%, transparent 100%);
    pointer-events: none;
}

.hero-gradient-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to top, rgba(15, 35, 59, 0.7) 0%, transparent 100%);
    pointer-events: none;
}

.hero-gradient-left {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 30%;
    background: linear-gradient(to right, rgba(15, 35, 59, 0.5) 0%, transparent 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 48px;
    text-align: center;
}

.hero-title {
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 600;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--silver);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Barlow', sans-serif;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--teal);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--teal-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--white);
    border: 1px solid var(--silver);
}

.btn-outline:hover {
    border-color: var(--teal);
    color: var(--teal-light);
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--steel);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-scroll-icon {
    width: 24px;
    height: 24px;
    animation: bounce 2s infinite;
}

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

/* ============================================
   Section Base Styles
   ============================================ */
.section {
    padding: 100px 48px;
    scroll-margin-top: 50px;
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 600px;
}

/* ============================================
   Projects Section
   ============================================ */
.projects {
    background-color: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.project-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--card-shadow);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--charcoal) 0%, var(--slate) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-image-placeholder {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--steel);
    letter-spacing: 0.05em;
}

.project-content {
    padding: 28px;
}

.project-category {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.project-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.project-description {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.project-accent {
    width: 32px;
    height: 2px;
    background-color: var(--teal);
    margin-top: 20px;
}

/* ============================================
   Contact Section
   ============================================ */
.contact {
    background-color: var(--bg-primary);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    margin-top: 48px;
}

.contact-info h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-item-icon {
    width: 20px;
    height: 20px;
    fill: var(--teal);
    flex-shrink: 0;
    margin-top: 2px;
}

.contact-item-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.contact-item-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.contact-item-value {
    font-size: 15px;
    color: var(--text-primary);
    word-break: break-word;
}

.contact-item-value a {
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.contact-item-value a:hover {
    color: var(--teal);
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    padding: 14px 16px;
    font-size: 15px;
    font-family: 'Barlow', sans-serif;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-tertiary);
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
}

.form-submit {
    align-self: flex-start;
    padding: 14px 40px;
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 15px;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(0, 128, 128, 0.1);
    border: 1px solid var(--teal);
    color: var(--teal);
}

.form-message.error {
    display: block;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    color: #dc3545;
}

.turnstile-wrapper {
    margin-bottom: 20px;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .hero-title {
        font-size: 56px;
    }

    .section-header h2 {
        font-size: 42px;
    }
}

/* Desktop to Tablet Landscape (1024px - 1400px) */
@media (max-width: 1400px) {
    .hero-title {
        font-size: 48px;
    }

    .hero-subtitle {
        font-size: 18px;
    }
}

/* Tablet Landscape (768px - 1024px) */
@media (max-width: 1024px) {
    .header {
        padding: 16px 32px;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-subtitle {
        font-size: 17px;
        max-width: 500px;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        gap: 40px;
    }

    .section {
        padding: 80px 32px;
    }

    .section-header h2 {
        font-size: 32px;
    }
}

/* Tablet Portrait (768px and below) */
@media (max-width: 768px) {
    .header {
        padding: 14px 20px;
    }

    .header .logo-subtext {
        display: none;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: var(--charcoal);
        padding: 24px;
        z-index: 999;
    }

    [data-theme="dark"] .nav-links {
        background: var(--white);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 16px 0;
        font-size: 20px;
        color: var(--white);
    }

    [data-theme="dark"] .nav-links a {
        color: var(--black);
    }

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

    .nav-cta {
        margin-top: 24px;
        text-align: center;
    }

    .mobile-menu-toggle {
        display: flex;
        z-index: 1000;
    }

    .section {
        padding: 64px 20px;
    }

    .hero {
        min-height: 100svh;
    }

    .hero-content {
        padding: 0 20px;
    }

    .hero-title {
        font-size: 32px;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 16px;
        max-width: 100%;
        line-height: 1.5;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .hero-actions .btn {
        width: 100%;
        text-align: center;
        padding: 14px 24px;
    }

    .section-header {
        margin-bottom: 40px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .section-header p {
        font-size: 15px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .project-card {
        padding: 24px;
    }

    .project-image {
        height: 160px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-info {
        order: 2;
    }

    .contact-form-wrapper {
        order: 1;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Large Mobile (480px - 768px) */
@media (max-width: 600px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .contact-item {
        flex-direction: row;
        text-align: left;
        gap: 12px;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }

    .logo-mark {
        font-size: 28px;
    }

    .section {
        padding: 48px 16px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .hero-actions {
        max-width: 100%;
    }

    .project-card {
        padding: 20px;
    }

    .project-title {
        font-size: 18px;
    }

    .form-input,
    .form-textarea,
    .form-select {
        padding: 12px 14px;
        font-size: 14px;
    }

    .form-submit {
        width: 100%;
    }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
    .hero-title {
        font-size: 24px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }

    .project-card:hover {
        transform: none;
    }

    .nav-links a:hover::after {
        width: 0;
    }

    /* Larger touch targets */
    .nav-links a {
        padding: 14px 0;
    }

    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .hero-canvas {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: var(--black);
    }

    .btn-primary {
        border: 2px solid var(--white);
    }

    .btn-secondary {
        border: 2px solid var(--black);
    }
}

/* Print Styles */
@media print {
    .header,
    .hero-canvas,
    .hero-background,
    .theme-toggle,
    .mobile-menu-toggle,
    .footer {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: 40px 20px;
        background: white !important;
        color: black !important;
    }

    .section {
        padding: 20px;
        break-inside: avoid;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
