/* ==========================================================
   K.M.I株式会社 コーポレートサイト 共通スタイル
   ========================================================== */
:root {
    --green-deep: #163d2a;
    --green: #1e5c3c;
    --green-mid: #2e7d50;
    --green-bright: #3fa066;
    --green-pale: #e9f4ee;
    --green-faint: #f5faf7;
    --ink: #1c2420;
    --gray: #5d6963;
    --line: #dde7e1;
    --gold: #b08d4f;
    --white: #ffffff;
    --shadow: 0 8px 30px rgba(22, 61, 42, 0.08);
    --shadow-hover: 0 16px 40px rgba(22, 61, 42, 0.14);
    --radius: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    --font-serif: 'Noto Serif JP', 'Hiragino Mincho ProN', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    line-height: 1.9;
    color: var(--ink);
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--green-mid); }

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    transition: var(--transition);
}

.site-header.scrolled { box-shadow: 0 4px 24px rgba(22, 61, 42, 0.1); }

.header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--green-deep);
}

.brand img { width: 48px; height: 48px; object-fit: contain; }

.brand .brand-name {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.brand .brand-tagline {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--gray);
    letter-spacing: 0.12em;
}

.global-nav ul {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.global-nav a {
    text-decoration: none;
    color: var(--ink);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    padding: 8px 0;
    position: relative;
    transition: var(--transition);
}

.global-nav a::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 0; height: 2px;
    background: var(--green-mid);
    transition: var(--transition);
}

.global-nav a:hover, .global-nav a[aria-current="page"] { color: var(--green-mid); }
.global-nav a:hover::after, .global-nav a[aria-current="page"]::after { width: 100%; }

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--green);
    color: var(--white) !important;
    padding: 10px 22px !important;
    border-radius: 50px;
    font-weight: 700;
}

.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--green-deep); color: var(--white); }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px; height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    display: block;
    width: 26px; height: 2px;
    background: var(--green-deep);
    transition: var(--transition);
}

.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav {
    display: none;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.mobile-nav.open { display: block; }

.mobile-nav ul { list-style: none; padding: 8px 0; }

.mobile-nav a {
    display: block;
    padding: 14px 24px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 500;
    border-bottom: 1px solid var(--green-faint);
}

.mobile-nav a:hover, .mobile-nav a[aria-current="page"] {
    color: var(--green-mid);
    background: var(--green-faint);
}

/* ---------- Hero (top) ---------- */
.hero {
    position: relative;
    min-height: min(88vh, 760px);
    display: flex;
    align-items: center;
    color: var(--white);
    isolation: isolate;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%; height: 100%;
    object-fit: cover;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(100deg, rgba(13, 38, 26, 0.88) 0%, rgba(22, 61, 42, 0.72) 45%, rgba(22, 61, 42, 0.35) 100%);
}

.hero-inner { padding-top: 120px; padding-bottom: 120px; }

.hero .en-label {
    color: #9fd3b4;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.9rem, 4.6vw, 3.4rem);
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.05em;
    margin: 16px 0 24px;
}

.hero .hero-lead {
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    max-width: 600px;
    opacity: 0.92;
    margin-bottom: 40px;
}

.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 38px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary { background: var(--green-bright); color: var(--white); }
.btn-primary:hover { background: var(--white); color: var(--green-deep); transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.btn-outline { border-color: rgba(255,255,255,0.7); color: var(--white); background: transparent; }
.btn-outline:hover { background: var(--white); color: var(--green-deep); }

.btn-solid { background: var(--green); color: var(--white); }
.btn-solid:hover { background: var(--green-deep); transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section.alt { background: var(--green-faint); }

.en-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    color: var(--green-bright);
    text-transform: uppercase;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 3.2vw, 2.3rem);
    font-weight: 700;
    color: var(--green-deep);
    letter-spacing: 0.06em;
    margin: 10px 0 18px;
    line-height: 1.5;
}

.section-lead {
    color: var(--gray);
    max-width: 720px;
    margin-bottom: 56px;
}

.section-head.center { text-align: center; }
.section-head.center .section-lead { margin-left: auto; margin-right: auto; }

/* ---------- Cards ---------- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 32px;
    transition: var(--transition);
}

.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: transparent; }

.card .card-num {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--gold);
    letter-spacing: 0.2em;
}

.card h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--green-deep);
    margin: 12px 0 14px;
    letter-spacing: 0.04em;
}

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

/* ---------- Service cards ---------- */
.service-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.service-card .thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.service-card .thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.service-card .body { padding: 28px 28px 32px; flex: 1; display: flex; flex-direction: column; }

.service-card h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--green-deep);
    margin-bottom: 12px;
    letter-spacing: 0.04em;
}

.service-card p { color: var(--gray); font-size: 0.95rem; margin-bottom: 18px; }

.check-list { list-style: none; margin-top: auto; }

.check-list li {
    position: relative;
    padding: 6px 0 6px 28px;
    color: var(--ink);
    font-size: 0.92rem;
    border-bottom: 1px dashed var(--line);
}

.check-list li:last-child { border-bottom: none; }

.check-list li::before {
    content: '';
    position: absolute;
    left: 4px; top: 14px;
    width: 12px; height: 7px;
    border-left: 2px solid var(--green-bright);
    border-bottom: 2px solid var(--green-bright);
    transform: rotate(-45deg);
}

/* ---------- Works gallery ---------- */
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.works-grid figure {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: zoom-in;
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--green-pale);
}

.works-grid img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.works-grid figure:hover img { transform: scale(1.06); }

.works-grid figcaption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 24px 16px 12px;
    background: linear-gradient(0deg, rgba(13, 38, 26, 0.75), transparent);
    color: var(--white);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
}

/* Top page works preview link card */
.works-cat {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    display: block;
    aspect-ratio: 4 / 3;
}

.works-cat img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.works-cat:hover img { transform: scale(1.06); }

.works-cat .cat-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    background: linear-gradient(0deg, rgba(13, 38, 26, 0.8) 0%, rgba(13, 38, 26, 0.1) 55%, transparent 100%);
    color: var(--white);
}

.works-cat .cat-label strong {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    letter-spacing: 0.06em;
}

.works-cat .cat-label span { font-size: 0.85rem; opacity: 0.9; }

/* ---------- Page hero (sub pages) ---------- */
.page-hero {
    background: linear-gradient(110deg, var(--green-deep) 0%, var(--green) 70%, var(--green-mid) 100%);
    color: var(--white);
    padding: 80px 0 64px;
    position: relative;
    overflow: hidden;
}

.page-hero::after {
    content: '';
    position: absolute;
    right: -120px; top: -120px;
    width: 380px; height: 380px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.page-hero::before {
    content: '';
    position: absolute;
    right: -60px; top: -60px;
    width: 380px; height: 380px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.page-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-top: 10px;
}

.page-hero p { opacity: 0.85; margin-top: 10px; font-size: 0.95rem; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    background: var(--green-faint);
    border-bottom: 1px solid var(--line);
    font-size: 0.85rem;
    padding: 12px 0;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb li + li::before { content: '›'; margin-right: 8px; color: var(--gray); }

.breadcrumb a { color: var(--green-mid); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--gray); }

/* ---------- Company table ---------- */
.company-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.company-table th, .company-table td {
    padding: 22px 28px;
    text-align: left;
    border-bottom: 1px solid var(--green-pale);
    vertical-align: top;
}

.company-table th {
    background: var(--green-faint);
    color: var(--green-deep);
    font-weight: 700;
    width: 220px;
    white-space: nowrap;
}

.company-table tr:last-child th, .company-table tr:last-child td { border-bottom: none; }

/* ---------- Philosophy ---------- */
.philosophy {
    border-left: 4px solid var(--green-bright);
    background: var(--green-faint);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 36px 40px;
    margin-top: 24px;
}

.philosophy p { color: var(--ink); max-width: 800px; }
.philosophy p + p { margin-top: 16px; }

/* ---------- Area ---------- */
.area-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.area-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.area-list li {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 18px;
    font-weight: 500;
}

.area-list li strong { color: var(--green-mid); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 840px; margin: 0 auto; }

.faq-item {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 56px 20px 24px;
    font-weight: 700;
    color: var(--green-deep);
    position: relative;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before { content: 'Q.'; color: var(--green-bright); margin-right: 10px; font-family: var(--font-serif); }

.faq-item summary::after {
    content: '';
    position: absolute;
    right: 24px; top: 50%;
    width: 10px; height: 10px;
    border-right: 2px solid var(--green-mid);
    border-bottom: 2px solid var(--green-mid);
    transform: translateY(-70%) rotate(45deg);
    transition: var(--transition);
}

.faq-item[open] summary::after { transform: translateY(-30%) rotate(225deg); }

.faq-item .faq-a {
    padding: 0 24px 22px;
    color: var(--gray);
}

.faq-item .faq-a::before { content: 'A.'; color: var(--gold); margin-right: 10px; font-weight: 700; font-family: var(--font-serif); }

/* ---------- CTA band ---------- */
.cta-band {
    background: linear-gradient(110deg, var(--green-deep), var(--green));
    color: var(--white);
    text-align: center;
    padding: 80px 24px;
}

.cta-band h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.cta-band p { opacity: 0.9; margin-bottom: 32px; }

.cta-band .tel {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 0.04em;
}

.cta-band .cta-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------- Contact ---------- */
.contact-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 56px;
}

.contact-method {
    background: var(--white);
    border-top: 4px solid var(--green-bright);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    text-align: center;
}

.contact-method h3 { color: var(--green-deep); font-size: 1.05rem; margin-bottom: 10px; }
.contact-method .big { font-size: 1.4rem; font-weight: 700; color: var(--green-mid); text-decoration: none; display: inline-block; }
.contact-method small { color: var(--gray); display: block; margin-top: 8px; }

.form-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px;
    max-width: 760px;
    margin: 0 auto;
}

.form-group { margin-bottom: 26px; }

.form-group label {
    display: block;
    font-weight: 700;
    color: var(--green-deep);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.required-badge {
    display: inline-block;
    background: #c0392b;
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 8px;
    margin-left: 8px;
    vertical-align: 2px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    background: var(--green-faint);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--green-bright);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(63, 160, 102, 0.12);
}

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

.form-note { font-size: 0.85rem; color: var(--gray); margin-bottom: 24px; }

.message { padding: 16px 20px; border-radius: 8px; margin-bottom: 24px; font-weight: 700; }
.message.success { background: #e6f4ea; color: #1d6b34; border: 1px solid #b9e0c5; }
.message.error { background: #fbeaea; color: #8e2520; border: 1px solid #f0c4c1; }

.loading {
    display: inline-block;
    width: 18px; height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

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

/* ---------- Footer ---------- */
.site-footer {
    background: var(--green-deep);
    color: rgba(255, 255, 255, 0.88);
    padding: 64px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.footer-brand img { width: 44px; height: 44px; background: var(--white); border-radius: 50%; padding: 3px; }

.footer-brand strong {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--white);
    letter-spacing: 0.05em;
}

.site-footer h3 {
    font-size: 0.95rem;
    color: #9fd3b4;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.site-footer p { font-size: 0.9rem; margin-bottom: 8px; }

.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 10px; }

.site-footer a { color: rgba(255, 255, 255, 0.88); text-decoration: none; transition: var(--transition); }
.site-footer a:hover { color: #9fd3b4; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    padding: 20px 0;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(8, 20, 14, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox img {
    max-width: min(92vw, 1100px);
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px; right: 24px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ---------- Scroll animation ---------- */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .fade-in { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .global-nav { display: none; }
    .hamburger { display: flex; }
    .grid-3 { grid-template-columns: 1fr; }
    .works-grid { grid-template-columns: repeat(2, 1fr); }
    .area-box { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 600px) {
    .section { padding: 64px 0; }
    .hero-inner { padding-top: 96px; padding-bottom: 96px; }
    .works-grid { grid-template-columns: 1fr; }
    .contact-methods { grid-template-columns: 1fr; }
    .form-container { padding: 28px 20px; }
    .company-table th { width: auto; display: block; border-bottom: none; padding-bottom: 6px; }
    .company-table td { display: block; padding-top: 0; }
    .brand .brand-name { font-size: 1.05rem; }
    .btn { width: 100%; }
    .hero-buttons { flex-direction: column; }
}
