/* SP Style (max-width: 768px) */
:root {
    --header-height: 60px;
}

body {
    overflow-x: hidden;
    padding-top: 0;
    transition: background-color 0.3s;
}

body.nav-open {
    overflow: hidden;
}

.bg-pattern {
    opacity: 0.3;
}

/* Header */
.header {
    width: 100%;
    height: var(--header-height);
    background: rgba(251, 250, 245, 0.95);
    border-right: none;
    border-bottom: 1px solid rgba(29, 37, 59, 0.1);
    display: flex;
    flex-direction: row;
    padding: 0 20px;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: var(--z-header);
}

.header__logo {
    writing-mode: horizontal-tb;
    font-size: 1.1rem;
    flex-direction: row;
    font-family: var(--font-gothic);
    letter-spacing: 0.2em;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    line-height: 1;

    /* Absolute Positioning for perfect center */
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.logo-mark {
    display: block;
    width: 20px;
    height: 20px;
    background-color: var(--color-vermilion);
    border-radius: 50%;
}

.header .header__menu-btn {
    display: flex;
    margin-left: auto;
    border: 1px solid rgba(29, 37, 59, 0.1);
    width: auto;
    height: 34px;
    padding: 0 10px;
    background: var(--color-white);
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 20px;
    top: 13px;
    z-index: var(--z-menu-btn);
    cursor: pointer;
    font-family: var(--font-mincho);
}

/* sp-menu-container related styles removed for unified fixed header */


.tate-text {
    writing-mode: horizontal-tb;
    letter-spacing: 0em;
    font-size: 11px;
    display: block;
    width: auto;
    white-space: nowrap;
    text-align: center;
}

/* Vertical Nav (Mobile Menu Overlay) */
.vertical-nav {
    display: flex !important;
    /* Force display block mechanism */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-white);
    z-index: var(--z-nav);
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

body.nav-open .vertical-nav {
    opacity: 1;
    visibility: visible;
}

.vertical-nav ul {
    flex-direction: column;
    gap: 40px;
    text-align: center;
}

.vertical-nav a {
    writing-mode: horizontal-tb;
    font-size: 1.2rem;
    padding: 10px 0;
    display: block;
    width: 200px;
    margin: 0 auto;
    border-bottom: 1px solid rgba(29, 37, 59, 0.1);
}

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

/* Main Content Adjustment */
main {
    margin-top: 0;
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    /* Full viewport height minus header */
    height: calc(100dvh - 60px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    scroll-snap-align: start;
}

.hero__image-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.image-mask {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(251, 250, 245, 0.3), rgba(251, 250, 245, 0.8));
    /* Soft overlay */
}

.placeholder-img {
    width: 100%;
    height: 100%;
    /* Placeholder color */
    background: linear-gradient(135deg, #e0e0e0 0%, #a0a0a0 100%);
    position: relative;
    background-size: cover;
    background-position: center;
}

.placeholder-img::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
}

.hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row-reverse;
    /* PC style vertical layout order */
    gap: 20px;
    /* Reduced gap */
    height: 80%;
    /* Increased height usage */
    align-items: center;
    /* Center vertically */
    justify-content: center;
}

.hero__lead {
    font-size: 1.0rem;
    /* Reduced */
    letter-spacing: 0.3em;
    line-height: 2.0;
    color: var(--color-indigo);
    height: 100%;
    margin-bottom: 0;
    writing-mode: vertical-rl;
}

.line-1,
.line-2 {
    display: block;
    margin-left: 0.5em;
    /* Spacing between lines */
}

.hero__main-title {
    height: 100%;
    margin: 0;
    writing-mode: vertical-rl;
}

.hero__main-title h2 {
    font-size: 2.4rem;
    /* Reduced base */
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.1em;
    color: var(--color-indigo);
    writing-mode: vertical-rl;
}

.char-l {
    font-size: 2.8rem;
    /* Reduced from 3.5rem */
}

.char-s {
    font-size: 2.0rem;
    /* Reduced from 2.5rem */
    margin: 5px 0;
}

.scroll-sign {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 2;
}

.scroll-sign span {
    font-family: var(--font-gothic);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    writing-mode: vertical-rl;
}

.scroll-sign .line {
    width: 1px;
    height: 60px;
    background-color: var(--color-indigo);
    animation: scrollLine 2s infinite;
}

@keyframes scrollLine {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    51% {
        transform: scaleY(1);
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* Philosophy */
.section {
    padding: 60px 20px;
    /* Reduced whitespace */
}

.philosophy {
    min-height: auto;
    /* Let content dictate height */
}

.philosophy .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.section-badge {
    margin-bottom: 0;
    writing-mode: horizontal-tb;
    border: 1px solid var(--color-vermilion);
    padding: 5px 15px;
    font-size: 0.8rem;
    color: var(--color-vermilion);
    letter-spacing: 0.1em;
}

.philosophy__title {
    height: auto;
    width: 100%;
    font-size: 1.1rem;
    /* Reduced */
    line-height: 1.8;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    letter-spacing: 0.1em;
    margin: 0 auto;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(200, 60, 35, 0.3);
    text-align: center;
    word-break: keep-all;
    overflow-wrap: normal;
}

.philosophy__text {
    text-align: center;
    /* Center align usually looks better with keep-all on mobile, or justify */
    margin-top: 0;
    font-size: 0.85rem;
    /* Reduced */
    line-height: 2.0;
    width: 100%;
    max-width: 100%;
    word-break: keep-all;
    overflow-wrap: normal;
}

.hanko {
    width: 50px;
    height: 50px;
    border: 2px solid var(--color-vermilion);
    color: var(--color-vermilion);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 10px 0 0 auto;
    /* Align to right */
    writing-mode: vertical-rl;
    font-size: 0.9rem;
    line-height: 1.2;
    opacity: 0.8;
}

/* Business */
.business__wrapper {
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    align-items: center;
    gap: 40px;
    /* Reduced from 60px */
    padding-top: 20px;
    /* Reduced from 40px */
}

.business__title-area {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    order: -1;
    /* Move to top */
}

.business__title-area h3 {
    writing-mode: vertical-rl;
    height: auto;
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    border-left: 1px solid var(--color-vermilion);
    padding-left: 15px;
    margin: 0 auto;
}

.business__list {
    flex-direction: column;
    width: 100%;
    gap: 40px;
    /* Increase gap for card separation */
}

.business-card {
    width: 100%;
    padding: 15px;
    /* Reduced from 30px */
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    /* Subtle shadow for card effect */
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    /* Horizontal layout */
    gap: 15px;
    align-items: center;
}

/* Numbering styling for card - to be safe even if HTML doesn't change yet */
.business-card::before {
    /* Fallback if no watermark element */
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 6rem;
    color: rgba(200, 60, 35, 0.05);
    font-family: var(--font-mincho);
    z-index: 0;
    pointer-events: none;
}

/* Specific numbering (needs HTML update or nth-child CSS) */
.business-card:nth-child(1)::before {
    content: '壱';
}

.business-card:nth-child(2)::before {
    content: '弐';
}

.business-card:nth-child(3)::before {
    content: '参';
}


.business-card h4 {
    position: relative;
    z-index: 1;
    font-size: 1.1rem;
    /* Reduced */
    margin-bottom: 10px;
    border-bottom: 1px solid var(--color-vermilion);
    padding-bottom: 5px;
    display: inline-block;
}

.business-card p {
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
    line-height: 1.8;
}

/* Hide original numbering container if it exists */
.business-card .num {
    display: none;
}

.business-card:hover {
    transform: none;
    /* Disable hover lift on mobile */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: var(--z-modal);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
}

.card-num {
    position: absolute;
    top: 0;
    left: 15px;
    font-size: 1.5rem;
    background: #fff;
    padding: 0 10px;
    color: var(--color-vermilion);
    z-index: 5;
    font-family: var(--font-mincho);
}

.card-img {
    width: 100px;
    /* Fixed width for horizontal layout */
    height: 100px;
    /* Reduced height */
    flex-shrink: 0;
    margin-bottom: 0;
    position: relative;
}

.card-img::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: -8px;
    bottom: -8px;
    border: 1px solid var(--color-indigo);
    z-index: -1;
}

.card-img--1 {
    background-image: url("../assets/business_advisory.png");
    background-size: cover;
    background-position: center;
}

.card-img--2 {
    background-image: url("../assets/business_development.png");
    background-size: cover;
    background-position: center;
}

.card-img--3 {
    background-image: url("../assets/business_web_strategy.png");
    background-size: cover;
    background-position: center;
}

.card-content h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--color-vermilion);
    display: inline-block;
    padding-bottom: 5px;
    line-height: 1.4;
}

.card-lead {
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: #555;
    font-weight: 700;
}

.card-detail {
    display: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: var(--z-modal);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    padding: 30px 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Animation */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#modal-title {
    font-family: var(--font-mincho);
    font-size: 1.3rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-vermilion);
    display: inline-block;
    padding-bottom: 5px;
}

#modal-body p {
    line-height: 1.6;
    color: #444;
    font-size: 0.9rem;
}

/* Employee */
.employee__container {
    padding: 0 20px;
}

.employee__head {
    margin-bottom: 30px;
    text-align: center;
}

.employee__head h3 {
    font-size: 1.6rem;
    font-family: var(--font-mincho);
    background-image: linear-gradient(var(--color-vermilion), var(--color-vermilion));
    background-position: center bottom 10px;
    background-repeat: no-repeat;
    background-size: 80% 1px;
    padding-bottom: 20px;
    letter-spacing: 0.1em;
    display: inline-block;
    writing-mode: horizontal-tb;
}

/* Employee Section */
.employee {
    padding-bottom: 60px;
}

.employee .container {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.employee__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    padding: 40px 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
    width: 100%;
    margin: 0 auto;
    position: relative;
}

/* Representative specific styling (Removed) */

.employee__img-box {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid #eee;
}

.employee__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee__info {
    text-align: center;
    width: 100%;
}

.employee__role {
    display: block;
    font-size: 0.8rem;
    color: var(--color-gray);
    letter-spacing: 0.1em;
    margin-bottom: 15px;
    font-family: var(--font-gothic);
}

/* Employee Section Style Completion */
.employee__name {
    display: block;
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 20px;
    letter-spacing: 0.2em;
    font-family: var(--font-mincho);
}

.employee__desc {
    font-size: 0.9rem;
    line-height: 2;
    text-align: left;
    width: 90%;
    margin: 0 auto;
    color: #4a4a4a;
}

/* Works Section */
.works {
    padding-bottom: 80px;
}

.works__container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.works__head {
    align-self: center;
    margin-bottom: 20px;
}

.works__head h3 {
    font-size: 1.5rem;
    letter-spacing: 0.2em;
    writing-mode: vertical-rl;
    text-orientation: upright;
    border-left: 1px solid var(--color-vermilion);
    padding-left: 15px;
    height: auto;
}

.works__list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    border-top: 1px solid #eee;
}

.works__item {
    padding: 25px 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background-color 0.3s;
}

.works__client {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-indigo);
    font-family: var(--font-mincho);
}

.works__desc {
    font-size: 0.85rem;
    color: var(--color-gray);
    padding-left: 0.5em;
}

/* Footer */
.footer {
    margin-left: 0;
    padding: 24px 0 12px;
    background-color: var(--color-indigo);
    color: var(--color-white);
}

.footer__container {
    flex-direction: column;
    gap: 15px;
    align-items: center;
    text-align: center;
}

.footer__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.logo-mark.small {
    width: 12px;
    height: 12px;
    background-color: var(--color-vermilion);
    border-radius: 50%;
}

.tate-links {
    flex-direction: column;
    /* Vertical stack on mobile */
    gap: 10px;
}

.tate-links a {
    writing-mode: horizontal-tb;
    color: var(--color-white);
}

.footer__copy {
    writing-mode: horizontal-tb;
    margin-top: 10px;
}