/* Custom CSS for Mainichi Building Management */
:root {
    /* Colors - Single Base Blue Theme */
    --primary: #1274AF;
    --primary-rgb: 18, 116, 175;
    /* Base solid deep blue */
    --primary-hover: #1688cc;
    --accent: hsl(45, 90%, 50%);
    /* Gold/Yellow accent */

    --text-main: hsl(0, 0%, 15%);
    --text-muted: hsl(0, 0%, 40%);
    --bg-main: hsl(0, 0%, 98%);
    --bg-card: hsl(0, 0%, 100%);
    --bg-dark: #0d547f;
    /* Deep blue background */

    /* Typography */
    --font-en: 'Marcellus', serif;
    --font-serif: 'Shippori Mincho', serif;
    --font-body: 'Noto Serif JP', serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Layout */
    --container-width: 1200px;
    --radius: 8px;
    --radius-lg: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.8;
    overflow-x: hidden;
    width: 100%;
    -webkit-font-smoothing: antialiased;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Base Classes */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

/* Typography Enhancements */
.section-title {
    font-family: var(--font-en);
    font-size: 3rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: var(--spacing-md);
    position: relative;
    display: inline-block;
}

.section-title .ja {
    display: block;
    font-style: normal;
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: -0.2rem;
    letter-spacing: 0.1em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--accent);
}

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

.text-center .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.1) 60%, transparent 100%);
    padding: 1.5rem 0;
}

.header.scrolled {
    top: 20px;
    width: calc(100% - 40px);
    max-width: 1400px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 0.8rem 2rem;
}

.header-inner {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header.scrolled .header-inner {
    width: 100%;
    /* Fill the pill container */
}

.header:not(.scrolled) .logo {
    filter: brightness(0) invert(1);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-link img {
    height: 50px;
    transition: var(--transition);
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 500;
    color: white;
    letter-spacing: 0.1em;
    transition: var(--transition);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.header.scrolled .logo-text {
    font-size: 1.2rem;
    color: var(--text-main);
    text-shadow: none;
}

.header.scrolled .logo-link img {
    height: 40px;
}

.global-nav .nav-list {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    line-height: 1.2;
    color: white;
    /* White when transparent */
    position: relative;
    padding: 5px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.header.scrolled .nav-list a {
    color: var(--text-main);
    text-shadow: none;
}

.nav-list .en {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    font-family: var(--font-en);
    text-transform: uppercase;
}

.nav-list .ja {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
    font-style: normal;
}

/* Cool underline hover */
.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

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

.global-nav a.btn-contact-nav {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    line-height: 1.2;
    background: var(--primary);
    color: white !important;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.global-nav a.btn-contact-nav::after {
    display: none;
}

.global-nav a.btn-contact-nav .en {
    font-size: 1.1rem;
    font-family: var(--font-en);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.global-nav a.btn-contact-nav .ja {
    font-size: 0.85rem;
    opacity: 1;
    font-style: normal;
}

.global-nav a.btn-contact-nav:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--bg-card);
    position: absolute;
    transition: var(--transition);
}

.header.scrolled .hamburger span {
    background: var(--text-main);
}

.hamburger.active {
    margin-top: 5px;
}

.hamburger.active span {
    background: white !important;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
    bottom: 0;
}

.hamburger.active span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - 40px);
    height: calc(100dvh - 40px);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 999;
    padding: 10vh 0;
    /* Equal top and bottom gaps */
    overflow-y: auto;
    border: 1px solid white;
}

.mobile-nav-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.mobile-nav.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-list li {
    margin: 1rem 0;
    /* Reduced from 2rem to address 'too wide' feedback */
    text-align: center;
}

.mobile-nav-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    color: white;
}

.mobile-nav-list .en {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    font-family: var(--font-en);
    text-transform: uppercase;
}

.mobile-nav-list .ja {
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    opacity: 0.8;
    font-style: normal;
}

.mobile-nav-footer {
    width: 100%;
    margin-top: auto;
    padding-top: 3rem;
    /* Guaranteed large space above logo */
}

.mobile-nav-footer .logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.mobile-nav-footer .mobile-logo-img {
    height: 60px;
    filter: brightness(0) invert(1);
}

.mobile-nav-footer .logo-text {
    font-family: var(--font-serif);
    font-size: 0.85rem !important;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    letter-spacing: 0.15em;
    text-shadow: none;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    background-color: var(--primary);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    perspective: 2500px;
    overflow: hidden;
    background-color: var(--primary);
    transform-style: preserve-3d;
}

@keyframes cubeZoomRotate {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(0.85);
    }

    70% {
        transform: scale(0.85);
    }

    100% {
        transform: scale(1);
    }
}

.hero-bg.is-transitioning {
    animation: cubeZoomRotate 2.2s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    /* Brighter, more natural colors */
    filter: saturate(0.8) brightness(1.1);
    /* Cube Rotation Origin at virtual center */
    transform-origin: 50% 50% -50vw;
    transform: rotateY(90deg);
    /* Rotate starts after zoom-out, finishes before zoom-in */
    transition: transform 1s 0.6s cubic-bezier(0.45, 0, 0.55, 1), opacity 0.5s 0.6s;
    z-index: 0;
    backface-visibility: hidden;
}

.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Adjusted for slightly more brightness while maintaining readability */
    background-image: linear-gradient(to right, rgba(var(--primary-rgb), 0.45) 0%, rgba(var(--primary-rgb), 0.1) 60%, rgba(var(--primary-rgb), 0.15) 100%);
    background-color: rgba(0, 0, 0, 0.1);
}

.hero-slide.active {
    opacity: 1;
    transform: rotateY(0deg);
    z-index: 2;
}

.hero-slide.prev {
    opacity: 1;
    transform: rotateY(-90deg);
    z-index: 1;
    transition: transform 1s 0.6s cubic-bezier(0.45, 0, 0.55, 1), opacity 0.5s 0.6s;
}

.hero-content {
    position: relative;
    z-index: 10;
    padding-left: 10%;
    color: white;
}

.hero-catchphrase {
    font-family: var(--font-serif);
    font-size: 4rem;
    line-height: 1.4;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hero-subtext {
    font-family: var(--font-en);
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    opacity: 0.9;
    text-transform: uppercase;
}

/* Scroll Prompt */
.scroll-prompt.icon-only {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.8;
    z-index: 10;
}

.mouse-icon {
    width: 20px;
    height: 32px;
    border: 2px solid white;
    border-radius: 10px;
    position: relative;
}

.mouse-icon::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 6px;
    background: white;
    border-radius: 1px;
    animation: scrollMouse 1.5s infinite;
}

@keyframes scrollMouse {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 15px);
        opacity: 0;
    }
}

.scroll-line {
    width: 1px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    animation: scrollDown 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes scrollDown {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(200%);
    }
}

/* Message Section */
.message-inner {
    display: flex;
    flex-direction: column;
}

.message-body {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
    margin-top: 2rem;
}

.message-text {
    flex: 1.2;
}

.message-lead {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.message-text p {
    margin-bottom: 1.5rem;
}

.signature {
    text-align: right;
    font-family: var(--font-serif);
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 1rem;
}

.signature .title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.signature .name {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-main);
}

.message-image {
    flex: 1;
}

.image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.image-wrapper img {
    transition: transform 1s ease-out;
}

/* Services */
.services {
    background-color: var(--bg-card);
    padding-bottom: 0;
    /* Let grid touch the bottom */
}

.section-desc {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
}

.service-grid {
    display: flex;
    flex-direction: column;
    gap: 15rem;
    /* Massive bold spacing */
    margin-top: 5rem;
    width: 100%;
}

.service-card {
    position: relative;
    display: block;
    width: 100%;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    transition: var(--transition);
}

.card-image {
    width: 75%;
    height: 600px;
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
    margin: 0;
}

.service-card:nth-child(even) .card-image {
    margin-left: 25%;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    transform-origin: top;
}

.service-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 5rem 4rem;
    border-radius: 20px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.service-card:nth-child(odd) .card-content {
    right: 5%;
}

.service-card:nth-child(even) .card-content {
    left: 5%;
}

.card-number {
    position: absolute !important;
    bottom: 20px;
    right: 20px;
    font-size: 15rem;
    color: hsla(156, 45%, 28%, 0.04);
    font-weight: 600;
    font-family: var(--font-en);
    z-index: 0;
    line-height: 0.8;
    pointer-events: none;
}

.card-content>* {
    position: relative;
    z-index: 1;
}

.card-content h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.5rem;
}

.card-details h4 {
    margin-top: 1rem;
    color: var(--text-main);
    font-size: 1.1rem;
}

.card-details p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* About / Company */
.about-inner {
    display: flex;
    gap: var(--spacing-lg);
}

.about-info {
    flex: 1;
}

.company-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-md);
}

.company-table th,
.company-table td {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.company-table th {
    text-align: left;
    width: 30%;
    color: var(--primary);
    font-weight: 500;
}

.access-info {
    margin-top: 2rem;
}

.access-info h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.access-info li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.access-info li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.about-map {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.map-wrapper {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-wrapper iframe {
    flex: 1;
    width: 100%;
    min-height: 100%;
}

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

.contact .section-title {
    color: white;
}

.contact .section-title .ja {
    color: rgba(255, 255, 255, 1);
}

.contact .section-desc {
    margin: 0 auto var(--spacing-lg);
    color: rgba(255, 255, 255, 1);
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    color: var(--text-main);
}

.contact-form dl.form-group {
    margin-bottom: 2rem;
    padding: 0;
}

.contact-form dt {
    margin: 0 0 0.8rem 0;
    padding: 0;
}

.contact-form dd {
    margin: 0;
    padding: 0;
}

.contact-form label {
    display: block;
    font-weight: bold;
}

.label-required {
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
    vertical-align: middle;
}

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.2);
}

.form-submit {
    text-align: center;
    margin-top: 2.5rem;
}

.btn-submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 4rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Mailform Modal (Thanks Window) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
}

.modal.modal-active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    color: var(--text-main);
}

.modal-content h3 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.modal-content p {
    line-height: 1.8;
    margin-bottom: 2rem;
}

.modal .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.modal .close:hover {
    color: var(--primary);
}

.btn-close {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

/* Mailform Error Messages */
.error_blank,
.error_format,
.error_match {
    display: inline-flex;
    align-items: center;
    color: #e63946;
    background: #fff5f5;
    border: 1px solid #ffccd5;
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    font-weight: bold;
}

.error_blank:empty,
.error_format:empty,
.error_match:empty {
    display: none;
}

.error_blank::before,
.error_format::before,
.error_match::before {
    content: '⚠';
    margin-right: 6px;
    font-size: 1rem;
}

/* Mailform Loading Layer */
.loading-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* Footer */
.footer {
    background: var(--primary);
    color: white;
    padding: var(--spacing-lg) 0 var(--spacing-sm);
}

.footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: var(--spacing-md);
}

.footer-logo-inner {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.footer-logo-inner img {
    height: 40px;
    filter: brightness(0) invert(1);
}

.footer-logo-inner .logo-text {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: white;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-shadow: none;
}

.footer-catchphrase {
    opacity: 0.8;
}

.footer-links ul {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    font-family: var(--font-en);
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

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

.footer-bottom {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Animations */
.js-reveal {
    opacity: 0;
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.fade-in-up {
    transform: translateY(40px);
}

.fade-in-right {
    transform: translateX(-40px);
}

.fade-in-left {
    transform: translateX(40px);
}

.js-reveal.is-active {
    opacity: 1;
    transform: translate(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-catchphrase {
        font-size: 3rem;
    }

    .message-inner,
    .message-body {
        flex-direction: column;
    }

    .about-inner {
        flex-direction: column;
    }

    .map-wrapper {
        min-height: 450px;
    }

    .card-image {
        width: 90%;
        height: 450px;
    }

    .service-card:nth-child(even) .card-image {
        margin-left: 10%;
    }

    .card-content {
        width: 60%;
        padding: 4rem;
        right: 2%;
    }

    .service-card:nth-child(even) .card-content {
        left: 2%;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
        /* Scale everything relatively down by ~12.5% */
    }

    .header.scrolled {
        width: calc(100% - 20px);
        padding: 0.6rem 1rem;
    }

    .global-nav {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .hero-content {
        padding-left: 5%;
    }

    .hero-catchphrase {
        font-size: 1.45rem;
        /* Increased by 20% for visibility while keeping within screen */
        line-height: 1.5;
        word-break: break-all;
    }

    .hero-subtext {
        font-size: 1.0rem;
        /* Increased by 20% for visibility */
        letter-spacing: 0.05em;
        word-break: break-all;
    }

    .section-title {
        font-size: 1.5rem;
        /* Significantly reduced from 2rem to ensure fit on all devices */
        letter-spacing: 0.05em;
        word-break: break-all;
    }

    .contact-form {
        padding: 2rem 1.5rem;
        /* Reduced from 4rem to maximize space on mobile */
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
        /* Forced to 16px to prevent iPhone auto-zoom on focus */
    }

    .service-grid {
        gap: 6rem;
        margin-top: 2rem;
    }

    .card-image {
        width: 100%;
        height: 300px;
        margin: 0 !important;
        border-radius: var(--radius-lg);
    }

    .card-content {
        position: relative;
        transform: none;
        top: 0;
        left: 0 !important;
        right: 0 !important;
        width: 90%;
        padding: 2.5rem 2rem;
        margin: -50px auto 0;
        border-radius: var(--radius-lg);
    }

    .footer-wrap {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .footer-links ul {
        flex-direction: column;
        gap: 1rem;
    }

    .br-sp-ignore {
        display: none;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.05rem !important;
    }

    .logo-link {
        gap: 8px;
    }

    .footer-logo-inner .logo-text {
        font-size: 1.2rem !important;
    }

    .company-table th,
    .company-table td {
        display: block;
        width: 100% !important;
        padding: 0.8rem 0;
    }

    .company-table th {
        border-bottom: none;
        padding-bottom: 0;
    }
}

/* Inline Style Migrations */

/* Hero Slides Backgrounds */
.hero-slide-1 {
    background-image: url('../img/hero_mansion.jpg');
}

.hero-slide-2 {
    background-image: url('../img/hero_cleaning.jpg');
}

.hero-slide-3 {
    background-image: url('../img/hero_building.jpg');
}

.hero-slide-4 {
    background-image: url('../img/hero_landscape.jpg');
}


/* Utility: Transition Delays */
.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

/* CEO Photo Section */
.ceo-photo-wrapper {
    aspect-ratio: 1 / 1;
    background: linear-gradient(to bottom, #DFDCDF, #D9D8DF);
}

.ceo-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

/* Map Iframe */
.about-map-iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Recruitment Info Block */
.recruitment-info {
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.recruitment-title {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.8rem;
    font-family: var(--font-serif);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recruitment-accent-line {
    display: inline-block;
    width: 4px;
    height: 1.2rem;
    background: var(--accent);
}

.recruitment-desc {
    margin-bottom: 0.5rem;
    font-weight: 400;
    font-size: 1.05rem;
    color: #fff;
}

.recruitment-note {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Form Radio Group */
.form-radio-group {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
}

.form-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

.form-radio-input {
    width: auto !important;
    margin-bottom: 0 !important;
}