/* ========================================
   Subpages Common Styles
   ======================================== */

/* Solid Header for subpages */
.header--solid {
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.header--solid .nav__link {
    color: var(--color-text);
}

.header--solid .nav__link--active {
    color: var(--color-primary);
}

.header--solid .nav__link--active::after {
    width: 100%;
}

.header--solid .logo-dark {
    display: block;
}

.header--solid .logo-white {
    display: none;
}

.header--solid .hamburger,
.header--solid .hamburger::before,
.header--solid .hamburger::after {
    background: var(--color-dark);
}

/* ========================================
   Page Hero (common for subpages)
   ======================================== */

.page-hero {
    padding: calc(80px + var(--space-16)) 0 var(--space-16);
    background: linear-gradient(135deg, var(--color-dark) 0%, #1a1f42 100%);
    text-align: center;
}

.page-hero__title {
    font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
    color: var(--color-white);
    margin-bottom: var(--space-4);
    line-height: 1.2;
}

.page-hero__subtitle {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.75);
    max-width: 700px;
    margin: 0 auto;
}

/* ========================================
   Services Page
   ======================================== */

.services-list {
    background: var(--color-lighter);
}

.service-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
    padding: var(--space-16) 0;
    border-bottom: 1px solid var(--color-light);
}

.service-detail:last-child {
    border-bottom: none;
}

.service-detail--reverse {
    direction: rtl;
}

.service-detail--reverse > * {
    direction: ltr;
}

.service-detail--featured {
    background: var(--color-white);
    margin: 0 calc(-1 * var(--container-padding));
    padding: var(--space-16) var(--container-padding);
    border-radius: var(--radius-lg);
}

@media (max-width: 968px) {
    .service-detail {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .service-detail--reverse {
        direction: ltr;
    }
}

.service-detail__badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
}

.service-detail__number {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: 800;
    color: var(--color-light);
    margin-bottom: var(--space-2);
}

.service-detail__title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-4);
}

.service-detail__description {
    font-size: var(--text-lg);
    color: var(--color-text-light);
    margin-bottom: var(--space-6);
}

.service-detail__features {
    margin-bottom: var(--space-6);
}

.service-detail__features li {
    position: relative;
    padding-left: var(--space-6);
    margin-bottom: var(--space-3);
    font-size: var(--text-base);
}

.service-detail__features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: 600;
}

.service-detail__tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.service-detail__tech span {
    padding: var(--space-2) var(--space-3);
    background: var(--color-light);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
}

/* Service Visuals */
.service-visual {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-visual--code {
    background: var(--color-dark);
}

.service-visual--code pre {
    margin: 0;
    font-family: 'Fira Code', monospace;
    font-size: var(--text-sm);
    color: #A5B4FC;
}

.service-visual--browser {
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--color-light);
}

.browser-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #E5E7EB;
}

.browser-bar span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #E5E7EB;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.browser-bar span:first-child { background: #ff5f57; }
.browser-bar span:nth-child(2) { background: #febc2e; }
.browser-bar span:nth-child(3) { background: #28c840; }

/* URL bar */
.browser-bar::after {
    content: 'remarkablesolutions.pl';
    flex: 1;
    margin-left: var(--space-4);
    padding: var(--space-1) var(--space-3);
    background: var(--color-white);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--color-text-light);
    border: 1px solid #E5E7EB;
}

.browser-content {
    flex: 1;
    padding: var(--space-6);
    background: var(--color-white);
}

/* Navigation mockup */
.browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-light);
}

.browser-header::before {
    content: '';
    width: 80px;
    height: 20px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #8B5CF6 100%);
    border-radius: var(--radius-sm);
}

.browser-header::after {
    content: '';
    display: flex;
    gap: var(--space-3);
    width: 120px;
    height: 12px;
    background: repeating-linear-gradient(
        90deg,
        var(--color-light) 0px,
        var(--color-light) 25px,
        transparent 25px,
        transparent 35px
    );
}

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

.browser-grid div {
    height: 100px;
    background: linear-gradient(135deg, var(--color-light) 0%, var(--color-lighter) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.browser-grid div::before {
    content: '';
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    right: var(--space-3);
    height: 16px;
    background: var(--color-white);
    border-radius: var(--radius-sm);
}

.browser-grid div::after {
    content: '';
    position: absolute;
    bottom: var(--space-3);
    left: var(--space-3);
    width: 60%;
    height: 8px;
    background: var(--color-primary);
    opacity: 0.3;
    border-radius: var(--radius-sm);
}

.service-visual--phone {
    background: var(--color-dark);
    max-width: 200px;
    margin: 0 auto;
    border-radius: 32px;
    padding: var(--space-2);
    flex-direction: column;
}

.phone-notch {
    width: 60px;
    height: 20px;
    background: var(--color-dark);
    border-radius: 0 0 12px 12px;
    margin: 0 auto var(--space-4);
}

.phone-content {
    flex: 1;
    background: var(--color-white);
    border-radius: 24px;
    padding: var(--space-4);
}

.phone-app-header {
    height: 40px;
    background: var(--color-primary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.phone-app-list div {
    height: 50px;
    background: var(--color-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
}

.service-visual--ai {
    background: linear-gradient(135deg, var(--color-dark) 0%, #1a1f42 100%);
}

.ai-brain {
    position: relative;
    width: 200px;
    height: 200px;
}

.ai-node {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--color-primary-light);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.ai-node:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.ai-node:nth-child(2) { top: 50%; right: 0; transform: translateY(-50%); }
.ai-node:nth-child(3) { bottom: 0; left: 50%; transform: translateX(-50%); }
.ai-node:nth-child(4) { top: 50%; left: 0; transform: translateY(-50%); }

.ai-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-white);
    font-size: var(--text-xl);
}

.service-visual--chat {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    background: var(--color-light);
}

.chat-bubble {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    max-width: 80%;
}

.chat-bubble--bot {
    background: var(--color-white);
    align-self: flex-start;
    box-shadow: var(--shadow-sm);
}

.chat-bubble--user {
    background: var(--color-primary);
    color: var(--color-white);
    align-self: flex-end;
}

.service-visual--game {
    background: linear-gradient(135deg, #1a1f42 0%, var(--color-dark) 100%);
}

.game-screen {
    text-align: center;
}

.game-character {
    font-size: 4rem;
    margin-bottom: var(--space-4);
}

.game-ui {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
}

.game-ui span {
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--color-white);
}

.service-visual--iot {
    background: linear-gradient(135deg, var(--color-light) 0%, var(--color-lighter) 100%);
}

.iot-hub {
    position: relative;
    width: 200px;
    height: 200px;
}

.iot-device {
    position: absolute;
    font-size: 2rem;
}

.iot-device:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.iot-device:nth-child(2) { top: 50%; right: 0; transform: translateY(-50%); }
.iot-device:nth-child(3) { bottom: 0; left: 50%; transform: translateX(-50%); }

.iot-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-white);
    font-size: var(--text-sm);
}

.service-visual--design {
    background: var(--color-light);
}

.design-canvas {
    position: relative;
    width: 200px;
    height: 150px;
}

.design-element {
    position: absolute;
    border-radius: var(--radius-md);
}

.design-element--1 {
    width: 100px;
    height: 100px;
    background: var(--color-primary);
    top: 0;
    left: 0;
}

.design-element--2 {
    width: 80px;
    height: 80px;
    background: var(--color-primary-light);
    top: 50px;
    left: 60px;
}

.design-element--3 {
    width: 60px;
    height: 60px;
    background: var(--color-accent);
    bottom: 0;
    right: 0;
}

.service-visual--cloud {
    flex-direction: column;
    gap: var(--space-4);
    background: linear-gradient(180deg, #EBF5FF 0%, var(--color-white) 100%);
}

.cloud-icon {
    font-size: 4rem;
}

.cloud-connections {
    display: flex;
    gap: var(--space-4);
    color: var(--color-primary);
    font-size: var(--text-2xl);
}

/* ========================================
   Projects Showcase Section
   ======================================== */

.projects-showcase {
    background: var(--color-light);
}

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

.project-card {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition-base);
    /* Scroll animation: start hidden */
    opacity: 0;
    transform: translateY(30px);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
    border-color: transparent;
}

.project-card.visible:hover {
    transform: translateY(-8px);
}

.project-card__image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-base);
}

.project-card:hover .project-card__image img {
    transform: scale(1.05);
}

/* Each card gets a unique gradient placeholder */
.project-card:nth-child(1) .project-card__image {
    background: linear-gradient(135deg, var(--color-primary) 0%, #8B5CF6 100%);
}

.project-card:nth-child(2) .project-card__image {
    background: linear-gradient(135deg, #8B5CF6 0%, var(--color-accent-secondary) 100%);
}

.project-card:nth-child(3) .project-card__image {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-secondary) 100%);
}

.project-card:nth-child(4) .project-card__image {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-primary) 100%);
}

.project-card:nth-child(5) .project-card__image {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-accent) 100%);
}

.project-card:nth-child(6) .project-card__image {
    background: linear-gradient(135deg, #6366F1 0%, #06B6D4 100%);
}

.project-card__number {
    position: absolute;
    bottom: var(--space-4);
    left: var(--space-4);
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1;
}

.project-card__body {
    padding: var(--space-6);
}

.project-card__title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
    color: var(--color-dark);
}

.project-card__description {
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin-bottom: var(--space-4);
    line-height: 1.6;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.project-card__tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--color-light);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-primary);
    transition: all var(--transition-fast);
}

.project-card:hover .project-card__tag {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Responsive: 2 columns on tablet */
@media (max-width: 1024px) {
    .projects-showcase__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive: 1 column on mobile */
@media (max-width: 480px) {
    .projects-showcase__grid {
        grid-template-columns: 1fr;
    }

    .project-card__image {
        height: 160px;
    }
}

/* ========================================
   About Page
   ======================================== */

.page-hero--about {
    padding-bottom: var(--space-16);
}

/* About Stats */
.about-stats {
    background: var(--color-dark);
    padding: var(--space-10) 0;
}

.about-stats__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    text-align: center;
}

@media (max-width: 768px) {
    .about-stats__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.about-stat__number {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--color-white);
}

.about-stat__label {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
}

/* About Story */
.about-story__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
}

@media (max-width: 768px) {
    .about-story__grid {
        grid-template-columns: 1fr;
    }
}

.about-story__title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-6);
}

.about-story__content p {
    font-size: var(--text-lg);
    color: var(--color-text-light);
    margin-bottom: var(--space-4);
}

.story-timeline {
    background: var(--color-light);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-white);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-year {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-primary);
    min-width: 60px;
}

.timeline-event {
    color: var(--color-text);
}

/* Values */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-6);
}

.value-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.value-card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    background: linear-gradient(135deg, var(--color-primary), #8B5CF6);
    border-radius: var(--radius-md);
    color: var(--color-white);
}

.value-card__title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
}

.value-card__description {
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin: 0;
}

/* Team */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
}

.team-member {
    text-align: center;
    padding: var(--space-6);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-light);
    transition: all var(--transition-base);
}

.team-member:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.team-member__avatar {
    position: relative;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #8B5CF6 50%, var(--color-accent-secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-2xl);
    color: var(--color-white);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.team-member__avatar::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px dashed rgba(99, 102, 241, 0.3);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.team-member:hover .team-member__avatar {
    transform: scale(1.05);
    transition: transform var(--transition-base);
}

.team-member__name {
    font-size: var(--text-lg);
    margin-bottom: var(--space-1);
}

.team-member__role {
    font-size: var(--text-sm);
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.team-member__bio {
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin: 0;
    line-height: 1.6;
}

/* Why Grid */
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
}

.why-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
}

.why-item__icon {
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    color: var(--color-white);
    flex-shrink: 0;
}

.why-item__content h3 {
    font-size: var(--text-lg);
    color: var(--color-white);
    margin-bottom: var(--space-2);
}

.why-item__content p {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* ========================================
   Legal Pages (Privacy Policy, Terms)
   ======================================== */

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-12) 0;
}

.legal-content__section {
    margin-bottom: var(--space-12);
}

.legal-content__section:last-child {
    margin-bottom: 0;
}

.legal-content h2 {
    font-size: var(--text-2xl);
    color: var(--color-dark);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-light);
}

.legal-content h3 {
    font-size: var(--text-lg);
    color: var(--color-dark);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
}

.legal-content p {
    font-size: var(--text-base);
    color: var(--color-text-light);
    line-height: 1.8;
    margin-bottom: var(--space-4);
}

.legal-content p:last-child {
    margin-bottom: 0;
}

.legal-content ul,
.legal-content ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

.legal-content li {
    font-size: var(--text-base);
    color: var(--color-text-light);
    line-height: 1.8;
    margin-bottom: var(--space-2);
}

.legal-content a {
    color: var(--color-primary);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.legal-content a:hover {
    color: var(--color-dark);
}

.legal-content strong {
    color: var(--color-text);
    font-weight: 600;
}

.legal-content__date {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: var(--color-lighter);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin-bottom: var(--space-8);
}

.legal-content__table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
}

.legal-content__table th,
.legal-content__table td {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-light);
    text-align: left;
    color: var(--color-text-light);
    line-height: 1.6;
}

.legal-content__table th {
    background: var(--color-lighter);
    font-weight: 600;
    color: var(--color-text);
}

@media (max-width: 768px) {
    .legal-content {
        padding: var(--space-8) 0;
    }

    .legal-content__section {
        margin-bottom: var(--space-8);
    }

    .legal-content__table {
        font-size: var(--text-xs);
    }

    .legal-content__table th,
    .legal-content__table td {
        padding: var(--space-2) var(--space-3);
    }
}

/* ========================================
   Animation Keyframes
   ======================================== */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}
