/* Color Palette */
:root {
    --bg-white: #faf8f5;
    --text-primary: #2a2520;
    --tone-safe: #6b9e6b;
    --tone-warning: #c49a3c;
    --tone-excess: #b85a4a;
    --scale-ink: #8a8278;
    --suggestion-blue: #5a7a94;
    --divider-gray: #d8d0c4;
    --footer-gray: #6b6560;
}

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

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

/* Main Container */
.container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.title {
    font-family: 'Shippori Mincho', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-primary);
}

.balance-scale {
    width: 200px;
    height: 180px;
    max-width: 90vw;
    margin: 0 auto;
}

.beam {
    transform-origin: 100px 160px;
    transition: transform 2s ease-in-out;
    transform: var(--tilt, rotate(0deg));
}

.subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
}

.text-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--divider-gray);
    width: min(70ch, 90vw);
    min-height: 120px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.8;
    padding: 16px 0;
    resize: none;
    outline: none;
    font-weight: 400;
    transition: border-color 0.3s ease;
}

.text-input:focus {
    border-bottom-color: var(--tone-safe);
}

.text-input::placeholder {
    color: #b5aca0;
    font-size: 0.95rem;
}

/* Tone Meter */
.tone-meter-container {
    width: min(70ch, 90vw);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.tone-meter-bg {
    width: 100%;
    height: 4px;
    background-color: #e8e4dc;
    border-radius: 2px;
    overflow: hidden;
}

.tone-meter-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--tone-safe), var(--tone-warning), var(--tone-excess));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.tone-labels {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #8a8278;
    font-weight: 400;
    padding: 0 4px;
}

.label-safe {
    color: var(--tone-safe);
}

.label-warning {
    color: var(--tone-warning);
}

.label-excess {
    color: var(--tone-excess);
}

/* Analysis Section */
.analysis-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    transition: all 0.3s ease;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 12px 0;
    border-bottom: 1px solid var(--divider-gray);
    align-items: flex-start;
}

.result-item:last-child {
    border-bottom: none;
}

.result-original {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: wavy underline var(--tone-excess);
    opacity: 0;
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.result-suggestion {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    color: var(--suggestion-blue);
    font-style: italic;
    margin-left: 1.5rem;
    position: relative;
}

.result-suggestion::before {
    content: "→";
    position: absolute;
    left: -1.2rem;
    color: var(--suggestion-blue);
}

/* Footer Section */
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 0 2rem;
    text-align: center;
    margin-top: auto;
}

.decorative-line {
    width: 80px;
    height: 1px;
    background-color: var(--divider-gray);
}

.proverb {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--footer-gray);
    letter-spacing: 0.05em;
}

.proverb-translation {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: #9a9087;
    font-style: italic;
    margin-top: -0.5rem;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 1.5rem 1rem;
    }

    .container {
        gap: 2rem;
    }

    .hero {
        gap: 1.5rem;
    }

    .balance-scale {
        width: 160px;
        height: 140px;
    }

    .title {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }

    .text-input {
        width: 100%;
        font-size: 1rem;
        min-height: 100px;
    }

    .tone-meter-container {
        width: 100%;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-suggestion {
        margin-left: 0;
        padding-left: 1.5rem;
    }

    .result-suggestion::before {
        left: 0;
    }

    .proverb {
        font-size: 1rem;
    }

    .proverb-translation {
        font-size: 0.85rem;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #b5aca0;
    font-size: 0.95rem;
    padding: 2rem 0;
    font-family: 'Inter', sans-serif;
}
