/*
 * Truffle — Stylesheet
 * 
 * Design principles:
 *   1. Language visibility is controlled ONLY by body.lang-* classes.
 *      No !important, no .hidden overrides.
 *   2. All spacing uses rem for consistent vertical rhythm.
 *   3. Modal is self-contained and properly sized for both EN/KO.
 */

/* ───────── Tokens ───────── */
:root {
    --color-bg: #FAFAF8;
    --color-surface: #FFFFFF;
    --color-text: #1B1B19;
    --color-muted: #6B6B64;
    --color-line: #E4E1DA;
    --color-overlay: rgba(28, 28, 26, 0.35);

    --font-body: 'Pretendard Variable', 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Lora', 'Pretendard Variable', Georgia, serif;

    --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    /* 17px */
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* ───────── i18n visibility ───────── */
/*
 * ROOT CAUSE FIX: Language spans have NO .hidden class.
 * Visibility is toggled purely via body class.
 * No !important needed anywhere.
 */
body.lang-en .i18n-ko {
    display: none;
}

body.lang-en .i18n-en {
    display: inline;
}

body.lang-ko .i18n-en {
    display: none;
}

body.lang-ko .i18n-ko {
    display: inline;
}

/* ───────── Layout ───────── */
.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 2.5rem;
}

/* ───────── Typography ───────── */
h1,
h2,
h3,
.logo-text {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--color-text);
}

/* ───────── Navbar ───────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.75rem 0;
    transition: background 0.4s var(--ease-out),
        padding 0.4s var(--ease-out),
        box-shadow 0.4s var(--ease-out);
}

.navbar.scrolled {
    background: rgba(250, 250, 248, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 0;
    box-shadow: 0 1px 0 var(--color-line);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--color-text);
}

.logo-text {
    font-size: 1.2rem;
    letter-spacing: 0.3px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.btn-nav {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--color-muted);
    cursor: pointer;
    transition: color 0.25s ease;
    padding: 0;
}

.btn-nav:hover {
    color: var(--color-text);
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--color-muted);
    user-select: none;
}

.lang-btn {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.2rem 0.3rem;
    cursor: pointer;
    color: var(--color-muted);
    transition: color 0.2s ease;
    border-radius: 3px;
}

.lang-btn.active {
    color: var(--color-text);
    font-weight: 500;
}

.lang-btn:hover {
    color: var(--color-text);
}

.lang-divider {
    opacity: 0.25;
    pointer-events: none;
}

/* ───────── Hero ───────── */
.hero {
    padding: 10rem 0 7rem;
}

.hero-title {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 2rem;
}

.hero-desc {
    font-size: 1.15rem;
    color: var(--color-muted);
    max-width: 720px;
    font-weight: 300;
    line-height: 1.85;
}

/* ───────── Pillars ───────── */
.pillars {
    padding-bottom: 6rem;
}

.divider {
    height: 1px;
    background: var(--color-line);
    margin-bottom: 4.5rem;
}

.pillar {
    margin-bottom: 4rem;
}

.pillar:last-child {
    margin-bottom: 0;
}

.pillar-title {
    font-size: 1.65rem;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.pillar-desc {
    color: var(--color-muted);
    font-weight: 300;
    max-width: 720px;
    line-height: 1.85;
}

/* ───────── About ───────── */
.about {
    padding-bottom: 6rem;
}

.about-title {
    font-size: 1.85rem;
    margin-bottom: 2rem;
}

.about-body p {
    color: var(--color-muted);
    font-weight: 300;
    max-width: 720px;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.85;
}

.about-body p:last-child {
    margin-bottom: 0;
}

/* ───────── Footer ───────── */
.footer {
    padding: 3.5rem 0;
    border-top: 1px solid var(--color-line);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    color: var(--color-muted);
    font-size: 0.85rem;
}

/* ───────── Scroll Reveal ───────── */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.7s var(--ease-out),
        transform 0.7s var(--ease-out);
}

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

/* ───────── Modal ───────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--color-surface);
    width: calc(100% - 3rem);
    max-width: 460px;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    border-radius: 14px;
    padding: 2.5rem 2.5rem 2rem;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.12);
    position: relative;
    transform: scale(0.96) translateY(8px);
    transition: transform 0.4s var(--ease-spring);
}

.modal-overlay.open .modal-box {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    display: flex;
    transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
    color: #444;
    background: #F2F2F0;
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.modal-subtitle {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ── Form ── */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.field {
    position: relative;
}

.field input,
.field textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-line);
    padding: 0.6rem 0 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--color-text);
    transition: border-color 0.3s ease;
    line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-bottom-color: var(--color-text);
}

.field label {
    position: absolute;
    left: 0;
    top: 0.6rem;
    color: #999;
    font-size: 0.95rem;
    pointer-events: none;
    transition: top 0.25s ease, font-size 0.25s ease, color 0.25s ease;
}

/* Float label up when focused or filled */
.field input:focus~label,
.field input:not(:placeholder-shown)~label,
.field textarea:focus~label,
.field textarea:not(:placeholder-shown)~label {
    top: -0.9rem;
    font-size: 0.72rem;
    color: var(--color-muted);
}

.field textarea {
    resize: vertical;
    min-height: 80px;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    gap: 1rem;
}

.form-status {
    font-size: 0.82rem;
    flex: 1;
    min-height: 1.2em;
}

.form-status.ok {
    color: #3B7A41;
}

.form-status.fail {
    color: #B53929;
}

.btn-send {
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    padding: 0.65rem 1.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.btn-send:hover {
    opacity: 0.85;
}

.btn-send:active {
    transform: scale(0.97);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ───────── Responsive ───────── */
@media (max-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero {
        padding: 8rem 0 5rem;
    }

    .nav-actions {
        gap: 1.25rem;
    }

    .modal-box {
        padding: 2rem 1.75rem 1.5rem;
    }

    .form-footer {
        flex-direction: column;
        align-items: stretch;
    }

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

/* ───────── Body scroll lock when modal is open ───────── */
body.modal-active {
    overflow: hidden;
}

/* ───────── Waitlist Button ───────── */
.hero-actions {
    margin-top: 2.5rem;
}

.btn-waitlist {
    background: #1B1B19;
    /* 검정색 버튼 */
    color: var(--color-surface);
    border: none;
    padding: 1rem 2.4rem;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.15);
}

.btn-waitlist:hover {
    opacity: 0.85;
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.2);
}

.btn-waitlist:active {
    transform: translateY(1px);
    box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.15);
}

/* 모바일 대응 (화면이 작아지면 버튼이 누르기 좋게 꽉 참) */
@media (max-width: 640px) {
    .hero-actions {
        margin-top: 2rem;
        display: flex;
    }

    .btn-waitlist {
        width: 100%;
        text-align: center;
        padding: 1.1rem 2rem;
    }
}