/* ============================================
   D2 Communications LLC — Apple-Inspired CSS
   Version 1.0 | January 2025
   ============================================ */

/* === CSS CUSTOM PROPERTIES === */
:root {
    /* Colors */
    --primary-black: #000000;
    --primary-gray: #1d1d1f;
    --secondary-gray: #86868b;
    --bg-white: #ffffff;
    --bg-off-white: #f5f5f7;
    --accent-blue: #0071e3;
    --accent-blue-hover: #0077ed;
    --success: #34c759;
    --border-light: #d2d2d7;

    /* Typography */
    --font-stack: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;
    --space-32: 128px;

    /* Layout */
    --max-width-content: 980px;
    --max-width-narrow: 680px;
    --max-width-wide: 1200px;
    --gutter: 24px;

    /* Animation */
    --ease-apple: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 400ms;
    --duration-slower: 600ms;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 980px;
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-stack);
    font-size: 17px;
    line-height: 1.47;
    color: var(--primary-gray);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

/* === TYPOGRAPHY === */
.text-large {
    font-size: 19px;
    line-height: 1.42;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.1;
    color: var(--primary-black);
}

/* === UTILITIES === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === NAVIGATION === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background var(--duration-base) var(--ease-apple);
}

.nav-scrolled .nav {
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.nav-logo {
    text-decoration: none;
    color: var(--primary-black);
    font-weight: 600;
    font-size: 18px;
    transition: opacity var(--duration-fast) var(--ease-apple);
}

.nav-logo:hover {
    opacity: 0.7;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle-bar {
    width: 18px;
    height: 2px;
    background-color: var(--primary-gray);
    border-radius: 2px;
    transition: all var(--duration-base) var(--ease-apple);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-8);
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--primary-gray);
    font-size: 12px;
    font-weight: 400;
    transition: color var(--duration-fast) var(--ease-apple);
}

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

.nav-cta {
    background: var(--accent-blue);
    color: var(--bg-white) !important;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-weight: 500 !important;
    transition: background var(--duration-fast) var(--ease-apple) !important;
}

.nav-cta:hover {
    background: var(--accent-blue-hover) !important;
}

/* === HERO SECTION === */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(52px + var(--space-16)) var(--gutter) var(--space-16);
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
}

.hero-content {
    animation: fadeInUp 1s var(--ease-apple) 0.2s both;
}

.hero-eyebrow {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-4);
}

.hero-title {
    font-size: 64px;
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: var(--space-6);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 24px;
    color: var(--secondary-gray);
    margin-bottom: var(--space-10);
    font-weight: 400;
}

.hero-cta {
    display: flex;
    gap: var(--space-4);
}

.hero-visual {
    animation: fadeInUp 1s var(--ease-apple) 0.4s both;
}

.hero-image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--duration-slow) var(--ease-apple);
}

.hero-image-wrapper:hover .hero-image {
    transform: scale(1.05);
}

.hero-scroll {
    position: absolute;
    bottom: var(--space-10);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    animation: fadeIn 1s var(--ease-apple) 0.8s both;
}

.hero-scroll-text {
    font-size: 12px;
    color: var(--secondary-gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-scroll-indicator {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--accent-blue), transparent);
    animation: scrollIndicator 2s ease-in-out infinite;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    font-size: 17px;
    font-weight: 400;
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: all var(--duration-base) var(--ease-apple);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-blue);
    color: var(--bg-white);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-blue);
}

.btn-secondary:hover {
    background: rgba(0, 113, 227, 0.1);
}

.btn-large {
    padding: 16px 32px;
    font-size: 19px;
}

.btn-full {
    width: 100%;
}

/* === ABOUT SECTION === */
.about {
    padding: var(--space-32) var(--gutter);
    background: var(--bg-off-white);
}

.about-container {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
}

.about-content {
    animation: fadeInUp 0.8s var(--ease-apple) both;
}

.section-eyebrow {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-4);
}

.section-title {
    font-size: 48px;
    font-weight: 600;
    line-height: 1.08;
    margin-bottom: var(--space-8);
    letter-spacing: -0.015em;
}

.section-subtitle {
    font-size: 21px;
    color: var(--secondary-gray);
    margin-bottom: var(--space-12);
    font-weight: 400;
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-bottom: var(--space-16);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
    margin-top: var(--space-16);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 56px;
    font-weight: 700;
    color: var(--accent-blue);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-label {
    font-size: 14px;
    color: var(--secondary-gray);
    font-weight: 500;
}

/* === SERVICES SECTION === */
.services {
    padding: var(--space-32) var(--gutter);
}

.services-container {
    max-width: var(--max-width-wide);
    margin: 0 auto;
}

.services-header {
    text-align: center;
    margin-bottom: var(--space-20);
    animation: fadeInUp 0.8s var(--ease-apple) both;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
}

.service-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transition: all var(--duration-slow) var(--ease-apple);
    animation: fadeInUp 0.8s var(--ease-apple) both;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.service-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-off-white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-6);
    color: var(--accent-blue);
}

.service-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.service-description {
    color: var(--secondary-gray);
    margin-bottom: var(--space-6);
    line-height: 1.5;
}

.service-features {
    list-style: none;
    border-top: 1px solid var(--border-light);
    padding-top: var(--space-5);
}

.service-features li {
    font-size: 14px;
    color: var(--primary-gray);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.checkmark {
    color: var(--success);
    font-weight: 600;
}

/* === HOME OFFICE SECTION === */
.home-office {
    padding: var(--space-32) var(--gutter);
    background: var(--bg-off-white);
}

.home-office-container {
    max-width: var(--max-width-wide);
    margin: 0 auto;
}

.home-office-header {
    text-align: center;
    margin-bottom: var(--space-20);
    animation: fadeInUp 0.8s var(--ease-apple) both;
}

.home-office-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-10);
    margin-bottom: var(--space-16);
}

.home-office-item {
    animation: fadeInUp 0.8s var(--ease-apple) both;
}

.home-office-item:nth-child(1) { animation-delay: 0.2s; }
.home-office-item:nth-child(2) { animation-delay: 0.4s; }
.home-office-item:nth-child(3) { animation-delay: 0.6s; }

.home-office-number {
    font-size: 64px;
    font-weight: 700;
    color: var(--bg-off-white);
    -webkit-text-stroke: 2px var(--accent-blue);
    margin-bottom: var(--space-4);
    line-height: 1;
}

.home-office-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.home-office-description {
    color: var(--secondary-gray);
    line-height: 1.5;
}

.home-office-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.8s var(--ease-apple) 0.4s both;
}

.home-office-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* === QUOTE SECTION === */
.quote {
    padding: var(--space-32) var(--gutter);
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0055b3 100%);
    color: var(--bg-white);
    text-align: center;
}

.quote-container {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
    animation: fadeInUp 0.8s var(--ease-apple) both;
}

.quote-title {
    font-size: 48px;
    color: var(--bg-white);
    margin-bottom: var(--space-4);
}

.quote-subtitle {
    font-size: 21px;
    opacity: 0.9;
    margin-bottom: var(--space-6);
}

.quote-text {
    font-size: 19px;
    opacity: 0.85;
    margin-bottom: var(--space-10);
}

/* === CONTACT SECTION === */
.contact {
    padding: var(--space-32) var(--gutter);
}

.contact-container {
    max-width: var(--max-width-wide);
    margin: 0 auto;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-16);
}

.contact-info {
    animation: fadeInUp 0.8s var(--ease-apple) both;
}

.contact-description {
    color: var(--secondary-gray);
    margin: var(--space-6) 0 var(--space-10);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.contact-item {
    display: flex;
    gap: var(--space-5);
    align-items: flex-start;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-off-white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.contact-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-gray);
    margin-bottom: var(--space-1);
}

.contact-value {
    font-size: 17px;
    color: var(--primary-gray);
}

.contact-link {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-apple);
}

.contact-link:hover {
    color: var(--accent-blue-hover);
}

/* === FORM === */
.contact-form-wrapper {
    animation: fadeInUp 0.8s var(--ease-apple) 0.2s both;
}

.contact-form {
    background: var(--bg-off-white);
    padding: var(--space-10);
    border-radius: var(--radius-lg);
}

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--primary-gray);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 16px 20px;
    font-size: 17px;
    font-family: var(--font-stack);
    color: var(--primary-gray);
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--duration-base) var(--ease-apple);
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

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

.form-success {
    text-align: center;
    padding: var(--space-16);
    background: var(--bg-off-white);
    border-radius: var(--radius-lg);
    animation: fadeInUp 0.6s var(--ease-apple) both;
}

.form-success svg {
    margin-bottom: var(--space-6);
}

.form-success h3 {
    font-size: 28px;
    margin-bottom: var(--space-3);
}

.form-success p {
    color: var(--secondary-gray);
}

/* === FOOTER === */
.footer {
    background: var(--bg-off-white);
    padding: var(--space-16) var(--gutter) var(--space-8);
    border-top: 1px solid var(--border-light);
}

.footer-container {
    max-width: var(--max-width-wide);
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-10);
    margin-bottom: var(--space-10);
}

.footer-logo {
    font-size: 21px;
    margin-bottom: var(--space-3);
}

.footer-tagline {
    font-size: 14px;
    color: var(--secondary-gray);
}

.footer-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--primary-gray);
}

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

.footer-list li {
    margin-bottom: var(--space-2);
}

.footer-list a {
    text-decoration: none;
    color: var(--secondary-gray);
    font-size: 14px;
    transition: color var(--duration-fast) var(--ease-apple);
}

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

.footer-bottom {
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.footer-copyright {
    font-size: 12px;
    color: var(--secondary-gray);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes scrollIndicator {
    0%, 100% {
        opacity: 0;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(10px);
    }
}

/* === SCROLL ANIMATIONS === */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-apple), transform 0.8s var(--ease-apple);
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

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

    .hero-visual {
        order: -1;
    }

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

    .home-office-grid {
        grid-template-columns: 1fr;
    }

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

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        padding: var(--space-6);
        gap: var(--space-4);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--duration-base) var(--ease-apple);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu a {
        font-size: 17px;
        padding: var(--space-3) 0;
    }

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

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

    .hero-cta {
        flex-direction: column;
    }

    .section-title {
        font-size: 32px;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .quote-title {
        font-size: 32px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }

    .section-title {
        font-size: 28px;
    }

    .stat-number {
        font-size: 40px;
    }

    .contact-form {
        padding: var(--space-6);
    }
}

/* === PRINT STYLES === */
@media print {
    .nav,
    .hero-scroll,
    .contact-form,
    .footer {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: var(--space-8);
    }

    .service-card {
        break-inside: avoid;
    }
}

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

:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}
