/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #D96846;
    --secondary-color: #6DB3D3;
    --accent-color: #843B62;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-white);
}

/* Remove all focus outlines and rectangles from links */
a {
    outline: none;
}

a:focus,
a:active,
a:focus-visible {
    outline: none;
    box-shadow: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    font-weight: 700;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    outline: none;
}

.logo:hover,
.logo:focus,
.logo:active {
    text-decoration: none;
    outline: none;
    box-shadow: none;
}

.logo:focus-visible {
    outline: none;
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
}

.company-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.company-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.company-tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-list a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    outline: none;
}

.nav-list a:hover,
.nav-list a:focus,
.nav-list a:active {
    outline: none;
    box-shadow: none;
}

.nav-list a:focus-visible {
    outline: none;
}

.nav-list a:hover {
    color: var(--primary-color);
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-list a:hover::after {
    width: 100%;
}

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

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

.lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
}

.lang-btn:hover {
    background-color: var(--bg-light);
}

.lang-btn .active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Hero Section */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc((var(--vh, 1vh) * 100) - var(--header-h, 0px));
    padding: clamp(4rem, 10vh, 6rem) 0;
    color: white;
    text-align: center;
    overflow: hidden;
}

@supports (height: 100dvh) {
    .hero {
        min-height: calc(100dvh - var(--header-h, 0px));
    }
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(135deg,
        rgba(217, 104, 70, 0.85) 0%,
        rgba(109, 179, 211, 0.75) 45%,
        rgba(132, 59, 98, 0.85) 100%);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 55%),
                radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.12), transparent 50%);
    pointer-events: none;
    mix-blend-mode: screen;
}

.hero-slideshow {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    will-change: opacity, transform;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1200ms ease-in-out;
    filter: blur(3px) saturate(110%);
}

.hero-slide.active {
    opacity: 0.9;
}

.hero-background {
    position: absolute;
    inset: -10%;
    pointer-events: none;
    z-index: 0;
}

.hero-bg-tile {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 48px;
    background-color: rgba(37, 99, 235, 0.28);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 55%;
    filter: blur(26px);
    opacity: 0.55;
    transform: translate3d(0, 0, 0);
}

.tile-ai {
    top: -40px;
    left: -60px;
    background-color: rgba(217, 104, 70, 0.35);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23ffffff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 24h40M12 40h40M20 16h24a8 8 0 0 1 8 8v16a8 8 0 0 1-8 8H20a8 8 0 0 1-8-8V24a8 8 0 0 1 8-8z'/%3E%3Ccircle cx='24' cy='32' r='4'/%3E%3Ccircle cx='40' cy='32' r='4'/%3E%3C/svg%3E");
}

.tile-iot {
    bottom: -100px;
    right: -40px;
    width: 360px;
    height: 360px;
    background-color: rgba(109, 179, 211, 0.3);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23ffffff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='32' cy='32' r='8'/%3E%3Ccircle cx='12' cy='20' r='6'/%3E%3Ccircle cx='52' cy='20' r='6'/%3E%3Ccircle cx='12' cy='44' r='6'/%3E%3Ccircle cx='52' cy='44' r='6'/%3E%3Cpath d='M18 22l8 6m12 0l8-6M26 36l-8 6m20-6l8 6M32 24V12m0 28v12'/%3E%3C/svg%3E");
}

.tile-dev {
    top: 50%;
    left: 50%;
    width: 280px;
    height: 280px;
    margin-top: -140px;
    margin-left: -140px;
    background-color: rgba(132, 59, 98, 0.32);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23ffffff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 24l-8 8 8 8M44 24l8 8-8 8M30 44l4-24'/%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

@media (min-width: 1024px) {
    .hero .container {
        max-width: 1400px;
    }

    .hero-content {
        max-width: 1200px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.75rem;
    }

    .hero-title {
        font-size: clamp(3.25rem, 5.5vw, 3.75rem);
        margin-bottom: 0;
    }

    [lang="ja"] .hero-title {
        white-space: nowrap;
    }

    .hero-text {
        font-size: 1.375rem;
        margin-bottom: 0;
    }

    .cta-button {
        font-size: 1.125rem;
        padding: 1.1rem 2.5rem;
        margin-top: 0.25rem;
    }
}

.hero-subtitle {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-text {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-button {
    display: inline-block;
    background-color: white;
    color: var(--primary-color);
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Services Section */
.services {
    padding: 5rem 0;
    background-color: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

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

.service-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 300ms ease, box-shadow 300ms ease;
    text-align: center;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: var(--primary-color);
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

.service-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.service-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* About Section */
.about {
    padding: 5rem 0;
    background-color: var(--bg-white);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.125rem;
}

.about-intro {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.about-mission {
    font-size: 1.125rem;
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(217, 104, 70, 0.08), rgba(109, 179, 211, 0.08));
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    margin-bottom: 2.5rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 767px) {
    .about-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.feature {
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    transition: var(--transition);
}

.feature:hover {
    background-color: #e0e7ff;
}

.feature h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* Tech Stack */
.stack {
    padding: 5rem 0;
    background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-light) 100%);
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.stack-card {
    position: relative;
    border-radius: 14px;
    padding: 1.25rem 1.25rem 1rem;
    background:
        linear-gradient(var(--bg-white), var(--bg-white)) padding-box,
        linear-gradient(135deg, rgba(29, 78, 216, 0.35), rgba(30, 64, 175, 0.35)) border-box;
    border: 1px solid transparent;
    box-shadow: var(--shadow-md);
}

.stack-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.stack-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--primary-color);
    background: rgba(29, 78, 216, 0.08);
}

.stack-icon svg { width: 22px; height: 22px; }

.stack-card h3 {
    font-size: 1.0625rem;
    color: var(--text-primary);
}

.stack-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: linear-gradient(180deg, #fff, #f8fafc);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Pricing */
.pricing {
    padding: 5rem 0;
    background-color: var(--bg-white);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pricing-card {
    position: relative;
    border-radius: 14px;
    padding: 1.75rem 1.5rem 1.5rem;
    background-color: var(--bg-light);
    box-shadow: var(--shadow-md);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.pricing-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.pricing-badge {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-bottom: 0.75rem;
}

.pricing-title {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.pricing-points { list-style: none; padding: 0; margin: 0 0 1rem; }
.pricing-points li { color: var(--text-secondary); margin: 0.4rem 0; }

@media (max-width: 767px) {
    .stack-grid, .pricing-grid { gap: 1rem; }
}

/* Merged Pricing layout */
.pricing-merged-card {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-radius: 16px;
    background:
        linear-gradient(var(--bg-white), var(--bg-white)) padding-box,
        linear-gradient(135deg, rgba(29, 78, 216, 0.35), rgba(30, 64, 175, 0.35)) border-box;
    border: 1px solid transparent;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.pricing-model {
    padding: 1.5rem 1.25rem;
    background-color: var(--bg-white);
}

.pricing-model:not(:last-child) {
    border-right: 1px dashed var(--border-color);
}

.pricing-model:hover {
    background-color: #f8fafc;
}

@media (max-width: 1023px) {
    .pricing-merged-card { grid-template-columns: 1fr; }
    .pricing-model:not(:last-child) {
        border-right: none;
        border-bottom: 1px dashed var(--border-color);
    }
}

/* Contact Section */
.contact {
    padding: 5rem 0;
    background-color: var(--bg-light);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-form {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background-color: var(--secondary-color);
}

.contact-info {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.info-item {
    margin-bottom: 1.5rem;
}

.info-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.info-item p {
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    text-align: center;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    justify-items: center;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.footer-section p {
    color: #9ca3af;
    line-height: 1.6;
}

.footer-tagline {
    font-size: 0.9375rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 0.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #9ca3af;
    text-decoration: none;
    transition: var(--transition);
    outline: none;
}

.footer-section ul li a:hover,
.footer-section ul li a:focus,
.footer-section ul li a:active {
    color: white;
    outline: none;
    box-shadow: none;
}

.footer-section ul li a:focus-visible {
    outline: none;
}

.footer-contact li span {
    color: #9ca3af;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    text-align: center;
    color: #9ca3af;
}

/* Tablet Styles (768px - 1023px) */
@media (max-width: 1023px) {
    .company-name {
        font-size: 0.9375rem;
    }

    .company-tagline {
        font-size: 0.6875rem;
    }

    .about-intro {
        font-size: 1.125rem;
    }

    .about-mission {
        font-size: 1.0625rem;
        padding: 1.25rem;
    }

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

    .hero {
        padding: 5rem 0;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-text {
        font-size: 1.05rem;
    }

    .hero-bg-tile {
        filter: blur(22px);
    }
}

/* Mobile Menu Backdrop */
.menu-backdrop {
    display: none;
}

@media (max-width: 767px) {
    .menu-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .menu-backdrop.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
}

/* Mobile Styles (≤767px) */
@media (max-width: 767px) {
    .logo {
        gap: 0.5rem;
    }

    .logo-img {
        height: 40px;
    }

    .company-name {
        font-size: 0.875rem;
    }

    .company-tagline {
        font-size: 0.625rem;
    }

    .about-intro {
        font-size: 1rem;
    }

    .about-mission {
        font-size: 0.9375rem;
        padding: 1rem;
    }

    .menu-toggle {
        display: flex;
    }

    .nav {
        position: relative;
    }

    .nav-list {
        position: fixed;
        top: 70px;
        right: 20px;
        background-color: var(--bg-white);
        flex-direction: column;
        width: 250px;
        box-shadow: var(--shadow-lg);
        border-radius: 8px;
        border: 1px solid var(--border-color);
        padding: 1rem;
        gap: 1rem;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 999;
    }

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

    .nav-list li {
        width: 100%;
    }

    .nav-list a {
        display: block;
        padding: 0.75rem;
        border-radius: 6px;
        transition: var(--transition);
    }

    .nav-list a:hover {
        background-color: var(--bg-light);
    }

    .nav-list a::after {
        display: none;
    }

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

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

    .hero {
        padding: 4rem 0;
    }

    .hero-bg-tile {
        width: 200px;
        height: 200px;
        filter: blur(18px);
        opacity: 0.4;
    }

    .tile-ai {
        top: -100px;
        left: -80px;
    }

    .tile-iot {
        bottom: -140px;
        right: -100px;
    }

    .tile-dev {
        display: none;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-text {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

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

    .about-features {
        grid-template-columns: 1fr;
    }
}

/* Desktop Large (≥1024px) */
@media (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature {
    animation: fadeIn 0.6s ease-out;
}
