/* 
   Smart Comfort: 법률사무소 안도 Design System v3 (Super Detail)
   Inspired by Toss & Premium Paper Texture
*/

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css");

:root {
    --bg-cream: #F5F3EE;
    --primary-green: #0A4228;
    --accent-gold: #C5A065;
    --text-dark: #1A2B23;
    --text-gray: #55635B;
    --text-light: #8C9690;
    --white: #FFFFFF;
    --container-width: 1400px;
    --shadow-soft: 0 12px 48px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    word-break: keep-all;
}

body {
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

/* Subtle Paper Grain */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 10000;
}

.container {
    width: 92%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Header - Toss Style Clean */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 32px 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.header.scrolled {
    padding: 16px 0;
    background-color: rgba(245, 243, 238, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 95%;
    /* Make it wider */
    max-width: var(--container-width);
}

.logo-ando {
    font-family: "Noto Serif KR", serif;
    font-size: 36px;
    color: var(--accent-gold);
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -1px;
}

.logo-text-right {
    display: none;
}

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

.nav a {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.2s;
}

.nav a:hover,
.nav a.active {
    color: var(--primary-green);
    transform: translateY(-2px);
}

.nav li {
    display: flex;
    align-items: center;
}

/* Typography */
.toss-title {
    font-size: 60px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -1.5px;
    color: var(--primary-green);
    white-space: nowrap;
    /* Forces layout to respect <br> only */
}

.toss-subtitle {
    font-size: 19px;
    color: var(--text-gray);
    font-weight: 500;
    margin-top: 20px;
}

.hero-pre-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 24px;
    letter-spacing: 1px;
}

/* Hero Section */
.hero {
    padding: 180px 0 120px;
    position: relative;
    overflow: visible;
}

.hero-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.hero-content {
    position: relative;
    z-index: 5;
    flex: 0 0 780px;
    /* Widened to fit the long second line at 60px */
}

.hero-visual {
    flex: 1;
    max-width: 650px;
    position: relative;
}

.hero-visual img {
    width: 100%;
    height: auto;
    border-radius: 48px;
    box-shadow: 0 40px 100px rgba(10, 66, 40, 0.15);
    transition: 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: block;
}

.hero-visual:hover img {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 60px 120px rgba(10, 66, 40, 0.2);
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 17px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--bg-cream);
    box-shadow: 0 8px 24px rgba(10, 66, 40, 0.15);
}

.hero .btn {
    font-size: 32px;
    padding: 32px 80px;
    letter-spacing: -1px;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 16px 40px rgba(10, 66, 40, 0.3);
}

/* Cards - Speech Bubble Style */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 80px;
}

.ando-card {
    background: var(--white);
    border-radius: 32px;
    overflow: hidden;
    /* For image corners */
    box-shadow: var(--shadow-soft);
    transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    text-align: left;
    /* Vertical look usually looks better with left alignment */
}

.ando-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px rgba(10, 66, 40, 0.1);
}

.ando-card .card-img {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.ando-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.6s ease;
}

.ando-card:hover .card-img img {
    transform: scale(1.1);
}

.ando-card .card-body {
    padding: 40px 32px;
}

.ando-card h4 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
    line-height: 1.4;
}

.ando-card p {
    font-size: 15px;
    color: var(--text-gray);
    line-height: 1.6;
}

/* Service Detail Section - Compact & Premium */
.service-section {
    padding: 100px 0;
}

.service-header {
    text-align: center;
    margin-bottom: 60px;
}

.service-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card-v2 {
    background: var(--white);
    padding: 32px 28px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 280px;
    /* Ensures all cards have at least this height */
}

.service-card-v2.accent {
    background: var(--primary-green);
    color: var(--white);
}

.service-card-v2 .s-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.service-card-v2 .s-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-gold);
    display: inline-block;
}

.service-card-v2 .s-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-gray);
    letter-spacing: -0.2px;
}

.service-card-v2.accent .s-label {
    color: rgba(255, 255, 255, 0.7);
}

.service-card-v2 h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.service-card-v2.accent h4 {
    color: var(--white);
}

.service-card-v2 p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-gray);
}

.service-card-v2.accent p {
    color: rgba(255, 255, 255, 0.8);
}

.service-card-v2 h4 span {
    color: inherit;
}

/* Situation Section - Dark Theme exactly like reference */
/* Situation Section - Solid Signature Green with Motion */
.situation-section {
    padding: 120px 40px;
    background: var(--primary-green);
    /* Final Solid Green */
    color: var(--white);
    text-align: center;
    border-radius: 60px;
    margin: 40px auto;
    max-width: var(--container-width);
}

.situation-section .toss-title {
    color: var(--white);
    font-size: 42px;
}

.situation-section .toss-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    max-width: 700px;
    margin: 24px auto 0;
}

.situation-grid-8 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 60px auto 0;
}

.sit-card {
    background: var(--white);
    padding: 40px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.sit-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.sit-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconFloat 3s ease-in-out infinite;
}

/* Staggered animation for icons */
.sit-card:nth-child(2n) .sit-icon {
    animation-delay: 1.5s;
}

.sit-card:nth-child(3n) .sit-icon {
    animation-delay: 0.8s;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.sit-card p {
    color: var(--primary-green);
    font-weight: 700;
    font-size: 18px;
}


/* Timeline - Super Clean */
.process-timeline {
    margin-top: 100px;
    position: relative;
    padding: 20px 0;
}

.timeline-track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gold);
    opacity: 0.2;
}

.process-timeline.active .timeline-track::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary-green);
    width: 0;
    animation: trackFlow 4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes trackFlow {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

.timeline-points {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.point-item {
    text-align: center;
    width: 20%;
    position: relative;
}

.point-dot {
    width: 14px;
    height: 14px;
    background: var(--accent-gold);
    border: 3px solid var(--bg-cream);
    border-radius: 50%;
    margin: 0 auto 32px;
    position: relative;
    z-index: 3;
    transition: all 0.4s ease;
}

.process-timeline.active .point-item:nth-child(1) .point-dot {
    animation: dotActive 0.5s forwards 0s;
}

.process-timeline.active .point-item:nth-child(2) .point-dot {
    animation: dotActive 0.5s forwards 1.3s;
}

.process-timeline.active .point-item:nth-child(3) .point-dot {
    animation: dotActive 0.5s forwards 2.6s;
}

.process-timeline.active .point-item:nth-child(4) .point-dot {
    animation: dotActive 0.5s forwards 4s;
}

@keyframes dotActive {
    0% {
        background: var(--accent-gold);
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
        background: var(--primary-green);
    }

    100% {
        background: var(--primary-green);
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(10, 66, 40, 0.05);
    }
}

.point-dot.active {
    background: var(--primary-green);
    border-color: var(--bg-cream);
}

.point-label {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary-green);
    letter-spacing: -0.3px;
}

/* Section Reveal */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Footer / Sticky */
.footer {
    padding: 80px 0 160px;
    text-align: center;
    opacity: 0.5;
    font-size: 13px;
}


/* Responsive */
@media (max-width: 900px) {
    .container {
        padding: 0 24px;
    }

    .toss-title {
        font-size: 34px;
        /* Reduced for better mobile fit */
        white-space: normal;
        text-align: center;
        margin-bottom: 20px;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        padding: 60px 0;
    }

    .hero-content {
        flex: none;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-visual {
        max-width: 100%;
        margin-top: 20px;
    }

    .hero .btn {
        font-size: 20px;
        padding: 16px 40px;
        width: 100%;
        max-width: 280px;
    }

    .card-grid,
    .service-grid-6,
    .situation-grid,
    .situation-grid-8 {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ando-card,
    .service-card-v2,
    .sit-card {
        text-align: center;
    }

    /* Navigation Mobile */
    .header {
        padding: 20px 0;
        /* More compact on mobile */
    }

    .header .container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .nav ul {
        gap: 20px;
    }

    /* Timeline Mobile */
    .timeline-points {
        gap: 10px;
    }

    .point-label {
        font-size: 12px;
    }
}

/* ============================================
   Cases Section with Category Cards
   ============================================ */

.cases-section {
    padding: 100px 0;
}

.case-category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 60px auto 0;
}

.case-category-card {
    position: relative;
    height: 420px;
    perspective: 1000px;
    cursor: pointer;
}

.category-front,
.category-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Front side - Default state */
.category-front {
    background: linear-gradient(145deg, #1B5E3C 0%, #0A4228 50%, #083621 100%);
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    z-index: 2;
}

.case-category-card:hover .category-front {
    opacity: 0;
    transform: scale(0.95);
    z-index: 1;
}

.category-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform 0.4s ease;
    color: var(--accent-gold);
}

.category-icon svg {
    width: 36px;
    height: 36px;
}

.case-category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-front h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
}

/* Back side - Hover state with case details */
.category-back {
    background: linear-gradient(145deg, #1B5E3C 0%, #0A4228 50%, #083621 100%);
    padding: 24px;
    opacity: 0;
    transform: scale(1.05);
    z-index: 1;
}

.case-category-card:hover .category-back {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

.category-icon-small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--accent-gold);
}

.category-icon-small svg {
    width: 18px;
    height: 18px;
}

.category-back h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 12px;
}

.case-tag-inline {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 12px;
}

.case-amount {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 4px;
}

.case-rate {
    font-size: 1.4rem;
    font-weight: 800;
    color: #4ADE80;
    margin-bottom: 12px;
}

.case-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 12px 0 14px;
}

.case-story {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
    flex-grow: 1;
}

/* Responsive for Case Cards */
@media (max-width: 1200px) {
    .case-category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .case-category-card {
        height: 440px;
    }
}

@media (max-width: 900px) {
    .case-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .case-category-card {
        height: 460px;
    }

    .category-front h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .case-category-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .case-category-card {
        height: auto;
        min-height: 200px;
    }

    /* On mobile, show both front and back stacked */
    .category-front,
    .category-back {
        position: relative;
        backface-visibility: visible;
        opacity: 1;
        transform: none;
    }

    .case-category-card:hover .category-front {
        opacity: 1;
        transform: none;
    }

    .case-category-card:hover .category-back {
        transform: none;
    }

    .category-front {
        padding: 20px;
        flex-direction: row;
        gap: 15px;
        justify-content: flex-start;
    }

    .category-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .category-back {
        display: flex;
    }
}