* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    background: #f8f7f4;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

.nav-menu {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #555;
    transition: transform 0.2s, opacity 0.2s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.menu-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background 0.15s;
}

.menu-dropdown a:hover {
    background: #f5f5f5;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 3rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.tagline {
    color: #5a5a5a;
    font-size: 1.5rem;
    letter-spacing: 0.01em;
}

.tag-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #888;
    cursor: pointer;
    padding: 0.5rem;
    min-height: 44px;
}

.tag-toggle input {
    cursor: pointer;
}

.input-label {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%) translateY(-8px);
    font-size: 0.875rem;
    color: #aaa;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out, transform 0.35s cubic-bezier(0.34, 1.02, 0.64, 1);
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.input-wrapper:hover .input-label,
.input-wrapper:focus-within .input-label,
.adverb-wrapper:hover .input-label,
.adverb-wrapper:focus-within .input-label {
    opacity: 1;
    transform: translateX(-50%) translateY(4px);
}

main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.main-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 9rem;
    flex-shrink: 0;
}

.adverb-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 12rem;
    flex-shrink: 0;
}

.arrow {
    font-size: 1.875rem;
    line-height: 1;
    color: #888;
    margin: 0 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem 0;
}

.arrow::before {
    content: "→";
}

#verb-input,
#adverb-input {
    padding: 0.5rem 0;
    font-size: 1.875rem;
    font-family: inherit;
    font-weight: 400;
    border: none;
    background: transparent;
    transition: border-color 0.2s;
    overflow: hidden;
    text-overflow: clip;
    caret-color: transparent !important;
}

#verb-input {
    width: 9rem;
}

#adverb-input {
    width: 12rem;
}

.custom-caret {
    position: absolute;
    width: 2px;
    height: 1.8em;
    background: #333;
    pointer-events: none;
    opacity: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.custom-caret.visible {
    animation: blink 0.85s step-end infinite;
    -webkit-animation: blink 0.85s step-end infinite;
    will-change: opacity;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@-webkit-keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.input-placeholder {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #767676;
    font-size: 1.875rem;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.fading .input-placeholder,
.fading .result-list,
.fading .share-icon {
    opacity: 0 !important;
}

.main-line .input-placeholder {
    transition: opacity 0.1s;
}

.main-line.idle-animating .input-placeholder,
.main-line.idle-animating .share-icon {
    transition: opacity 1s;
}

.main-line .result-list {
    transition: transform 0.3s ease-out, opacity 1s;
}

#verb-input {
    border-bottom: 2px solid #ccc;
}

#verb-input,
#adverb-input {
    text-align: center;
}

#verb-input:focus,
#adverb-input:focus {
    outline: none;
}


#verb-input:focus {
    border-bottom-color: #aaa;
}

.adverb-wrapper {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #ccc;
}

.adverb-wrapper:focus-within {
    border-bottom-color: #aaa;
}


.result-picker {
    position: relative;
    width: 14rem;
    height: 28rem;
    overflow: hidden;
    flex-shrink: 0;
}

.result-picker::before,
.result-picker::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 48px;
    pointer-events: none;
    z-index: 1;
}

.result-picker::before {
    top: 0;
    background: linear-gradient(to bottom, #f8f7f4 0%, transparent 100%);
}

.result-picker::after {
    bottom: 0;
    background: linear-gradient(to top, #f8f7f4 0%, transparent 100%);
}

.result-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 1s;
    will-change: transform, opacity;
}

.result-word {
    font-size: 1.875rem;
    line-height: 1;
    color: #6366F1;
    cursor: pointer;
    transition: opacity 0.3s, color 0.15s;
    padding: 0.5rem 0;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.result-word:hover {
    color: #4F46E5;
}

.result-tag {
    font-size: 0.55em;
    font-style: italic;
    color: inherit;
    margin-left: 0.4em;
    opacity: 0.7;
}

.share-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    color: #6366F1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.05s ease-out;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

.share-icon.visible {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.2s ease-out;
}

.share-icon:hover {
    color: #4F46E5;
}

.hide-tags .result-tag {
    display: none;
}


.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease-out;
    z-index: 100;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 600px) {
    .container {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .tagline {
        font-size: 1rem;
    }

    main {
        min-height: auto;
        padding: 1rem 0;
    }

    .main-line {
        flex-direction: column;
        gap: 1rem;
    }

    .input-wrapper,
    .adverb-wrapper {
        width: 100%;
        max-width: 14rem;
    }

    #verb-input,
    #adverb-input {
        font-size: 1.5rem;
        width: 100%;
    }

    .input-placeholder {
        font-size: 1.5rem;
    }

    .arrow {
        margin: 0.5rem 0;
        font-size: 1.5rem;
        min-height: auto;
        padding: 0;
    }

    .arrow::before {
        content: "↓";
    }

    .result-picker {
        width: 100%;
        max-width: 100%;
        height: auto;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .result-picker::before,
    .result-picker::after {
        display: none;
    }

    .result-list {
        flex-direction: row;
        gap: 0.75rem;
        padding: 0.5rem 0;
        overflow: visible;
        transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .result-word {
        font-size: 1.25rem;
        padding: 0.5rem 0.75rem;
        flex-shrink: 0;
        transition: opacity 0.3s;
    }

    .share-icon {
        position: static;
        width: 24px;
        height: 24px;
        margin-top: 1rem;
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ad Banner - Uncomment when ready
.ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0.5rem;
    background: #f0efe9;
    border-top: 1px solid #ddd;
}

.ad-placeholder {
    width: 728px;
    max-width: 100%;
    height: 90px;
    background: #e5e4de;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.875rem;
}
*/
