/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #666666;
    --color-border: #e5e5e5;
    
    --max-width: 1400px;
    --grid-max-width: 1152px;
    --border-radius: 0.875rem;
    --transition: 200ms ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Top Bar */
.top-bar {
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
}

.top-bar-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    min-width: 0;
}

.name {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.email-button {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
    flex-shrink: 0;
    font-size: 0.875rem;
    font-family: inherit;
}

.email-button:hover {
    color: var(--color-text);
}

.email-icon {
    display: block;
}

.email-row {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
    display: none;
    padding-top: 8px;
}

.top-bar.email-open .email-row {
    display: block;
}

.email-text {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    user-select: all;
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
    word-break: break-all;
    display: inline-block;
    padding: 0;
}

.email-text:hover {
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

.social-link {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
    text-decoration: none;
    flex-shrink: 0;
}

.social-link:hover {
    color: var(--color-text);
}

.social-link svg {
    display: block;
}

/* Hero Section */
.hero {
    padding: 8px 16px;
    text-align: center;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hero-portrait {
    width: 80px;
    height: 80px;
    border-radius: 0.5rem; /* rounded-lg */
    object-fit: cover;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: block;
    margin-bottom: 6px;
}

.hero-title {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 6px;
    margin-top: 0;
}

.hero-blurb {
    font-size: clamp(0.8125rem, 1.6vw, 0.9375rem);
    line-height: 1.35;
    color: var(--color-text-muted);
    max-width: 600px;
    margin-bottom: 0;
    margin-top: 0;
}

/* Tools Section */
.tools-section {
    padding: 10px 16px;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-surface);
}

.tools-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.tools-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

/* Ticker - Hidden by default (shown on mobile) */
.tools-ticker {
    display: none;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.ticker-track {
    display: flex;
    gap: 8px;
    will-change: transform;
    width: fit-content;
    animation: ticker-scroll 30s linear infinite;
}

.ticker-set {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.ticker-track:hover,
.ticker-track:focus-within {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .ticker-track {
        animation: none;
    }
    
    .tools-ticker {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ticker-track {
        width: auto;
    }
}

.tool-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    min-height: 24px;
}

.tool-logo {
    height: 16px;
    width: auto;
    max-width: 80px;
    opacity: 0.7;
    filter: grayscale(100%);
    transition: opacity var(--transition), filter var(--transition);
}

.tool-badge:hover .tool-logo {
    opacity: 1;
    filter: grayscale(0%);
}

.tool-badge-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* Media Wall */
.media-wall {
    padding: 8px 16px;
}

.media-grid-center {
    max-width: 1152px; /* max-w-7xl */
    margin: 0 auto;
    padding: 0 16px; /* px-4 */
}

/* Mobile: CSS Grid with [P,P] then [L] pattern */
.media-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

.media-tile {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform var(--transition);
    background-color: #f5f5f5;
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.media-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Landscape tiles span both columns on mobile */
.media-tile.tile-wide {
    grid-column: span 2;
}

.media-tile.tile-wide .tile-video {
    aspect-ratio: 16 / 9;
}

.tile-video {
    width: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 4 / 5;
    background-color: #f5f5f5;
}

.tile-footer {
    width: 100%;
    background-color: #000000;
    padding: 6px 8px;
}

.tile-label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    line-height: 1.2;
    pointer-events: none;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    z-index: 1001;
    max-width: min(1000px, 95vw);
    max-height: 90vh;
    width: 100%;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1002;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: background-color var(--transition), transform var(--transition);
    padding: 0;
    flex-shrink: 0;
}

.lightbox-close:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.lightbox-close:active {
    transform: scale(0.95);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

@media (max-width: 640px) {
    .lightbox-close {
        width: 44px;
        height: 44px;
        top: 12px;
        right: 12px;
    }
    
    .lightbox-close svg {
        width: 22px;
        height: 22px;
    }
    
    .lightbox-content {
        max-width: 98vw;
        max-height: 85vh;
    }
}

.lightbox-video {
    width: 100%;
    height: 100%;
    max-height: 90vh;
    max-width: 100vw;
    object-fit: contain;
    border-radius: var(--border-radius);
    background-color: #000;
}

/* Validation Section */
.validation-section {
    padding: 10px 16px;
    border-top: 1px solid var(--color-border);
    margin-top: 10px;
}

.validation-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.validation-item {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.6;
}

/* Footer */
.site-footer {
    padding: 40px 16px;
    border-top: 1px solid var(--color-border);
    background-color: var(--color-surface);
    margin-top: 20px;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.footer-image {
    width: 184px;
    height: 184px;
    border-radius: 0.75rem;
    object-fit: cover;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: block;
}

.footer-validation {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.6;
    text-align: center;
    max-width: 700px;
    margin-top: 16px;
}

.footer-inquiries {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inquiries-label {
    color: var(--color-text-muted);
}

.inquiries-name {
    color: var(--color-text);
}

.inquiries-phone {
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition);
    white-space: nowrap;
}

.inquiries-phone:hover {
    color: var(--color-text-muted);
    text-decoration: underline;
}

/* Desktop: CSS Grid layout (>= 641px) */
@media (min-width: 641px) {
    .media-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px; /* gap-4 */
        width: 100%;
    }
    
    .media-tile {
        width: 100%;
    }
    
    .tile-video {
        aspect-ratio: 9 / 16; /* Portrait: 9/16 */
    }
    
    .tile-label {
        font-size: 0.6875rem; /* Slightly larger on desktop */
    }
    
    .media-tile.tile-wide {
        grid-column: 1 / -1; /* Span all 3 columns */
    }
    
    .media-tile.tile-wide .tile-video {
        aspect-ratio: 16 / 9; /* Landscape: 16/9 */
    }
}

@media (min-width: 1024px) {
    .media-grid {
        gap: 20px; /* lg:gap-5 */
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .tools-label {
        font-size: 0.625rem;
        margin-bottom: 4px;
    }
    
    .tools-grid {
        display: none;
    }
    
    .tools-ticker {
        display: block;
    }
    
    .tool-badge {
        padding: 4px 8px;
        min-height: 20px;
        white-space: nowrap;
    }
    
    .tool-logo {
        height: 12px;
    }
    
    .tool-badge-text {
        font-size: 0.6875rem;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 10px 8px;
    }
    
    .top-bar-content {
        gap: 0.75rem;
    }
    
    .social-links {
        gap: 0.75rem;
    }
    
    .hero {
        padding: 8px 8px;
    }
    
    .hero-portrait {
        width: 96px;
        height: 96px;
    }
    
    .hero-content {
        gap: 8px;
    }
    
    .tools-section {
        padding: 10px 8px;
    }
    
    .media-wall {
        padding: 8px 8px;
    }
    
    .media-grid {
        gap: 8px;
    }
    
    .validation-section {
        padding: 10px 8px;
    }
}

@media (max-width: 640px) {
    .social-links {
        gap: 0.5rem;
    }
    
    .social-link svg,
    .email-button svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .email-text {
        font-size: 0.8125rem;
    }
    
    .hero-title {
        font-size: 1.375rem;
    }
    
    .hero-blurb {
        font-size: 0.8125rem;
    }
    
    .validation-item {
        font-size: 0.875rem;
    }
    
    .site-footer {
        padding: 32px 16px;
    }
    
    .footer-image {
        width: 138px;
        height: 138px;
    }
    
    .footer-validation {
        font-size: 0.875rem;
        margin-top: 12px;
    }
    
    .footer-inquiries {
        font-size: 0.875rem;
    }
}
