:root {
    /* Warm & soft direction palette */
    --bg: oklch(97% 0.018 70);
    --surface: oklch(99% 0.008 70);
    --fg: oklch(22% 0.02 50);
    --muted: oklch(50% 0.018 50);
    --border: oklch(90% 0.014 70);
    --accent: oklch(64% 0.13 28);

    --font-display:
        "Tiempos Headline", "Newsreader", "Iowan Old Style", Georgia, serif;
    --font-body:
        "Söhne", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
        sans-serif;
    --radius: 16px;

    /* Vertical rhythm — top/bottom split so “upper” band breathes */
    --space-section-top: clamp(4.25rem, 6.5vw, 5.5rem);
    --space-section-bottom: clamp(4rem, 6.25vw, 5.25rem);
    --space-hero-top: clamp(2.75rem, 5vw, 3.75rem);
    --space-hero-bottom: clamp(5rem, 7.5vw, 6.25rem);
    --space-footer-top: clamp(4.5rem, 8vw, 5.5rem);
    --space-footer-bottom: clamp(2.75rem, 5vw, 3.75rem);

    color-scheme: light;
}

* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Korean: line breaks follow spaces, not arbitrary syllable cuts */
main p,
footer p {
    word-break: keep-all;
    overflow-wrap: break-word;
    line-break: strict;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    text-wrap: balance;
}

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

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 8px;
    z-index: 200;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}

/* Header — a touch more space below nav before hero */
header {
    padding: 2.5rem 0 2.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.lang-toggle {
    display: flex;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

.lang-toggle button {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.lang-toggle button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.lang-toggle button.active {
    color: var(--fg);
    background: var(--surface);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Hero */
.hero {
    padding: var(--space-hero-top) 0 var(--space-hero-bottom);
    text-align: center;
}

.hero h1 {
    font-size: clamp(48px, 8vw, 84px);
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    /* Don’t split a short headline into two “balanced” lines */
    text-wrap: wrap;
}

.hero p {
    font-size: clamp(18px, 3vw, 24px);
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto 48px;
}

.hero-image {
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sections — distinct top inset so titles aren’t glued to prior band */
section:not(.hero) {
    padding-top: var(--space-section-top);
    padding-bottom: var(--space-section-bottom);
}

.section-title {
    font-size: 32px;
    margin-top: 0;
    margin-bottom: clamp(2.75rem, 4vw, 3rem);
    text-align: center;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
}

.feature-card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.03);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: oklch(from var(--accent) l c h / 0.1);
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 15px;
    color: var(--muted);
    margin: 0;
}

/* History/Concept */
.concept {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

@media (max-width: 768px) {
    .concept {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

.concept-text p {
    margin-bottom: 24px;
    font-size: 18px;
}

/* Instructions / Dial */
.instructions {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 60px;
    border: 1px solid var(--border);
}

.dial-guide {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.dial-item {
    flex: 1;
}

.dial-item h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

.dial-item p {
    color: var(--muted);
    font-size: 15px;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.gallery-item {
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Links */
.links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 60px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        background-color 0.2s ease;
    touch-action: manipulation;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.btn-primary {
    background: var(--fg);
    color: var(--bg);
}

.btn-secondary {
    background: var(--surface);
    color: var(--fg);
    border: 1px solid var(--border);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Footer — extra air above the rule, tighter below */
footer {
    padding: var(--space-footer-top) 0 var(--space-footer-bottom);
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
}

/* Language Support */
[lang="en"] .ko-only {
    display: none;
}
[lang="ko"] .en-only {
    display: none;
}

/* Tweaks Panel */
.tweaks {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    font-size: 13px;
}

.tweaks-title {
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tweak-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

input[type="color"] {
    border: none;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
}
