/* Landing page for chandrakumar.com — all white, plain CSS, no build step.
 *
 * The cycling word + Enter button are centred vertically and
 * horizontally. The visitor flow lives in an overlay on top of the
 * page, not in the page layout, so the page never moves to make
 * room for a form. */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: #111111;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

main {
    width: 100%;
    max-width: 560px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
}

/* Cycling word: large, bold, black, centred. min-height reserves the
   space so the page does not jump when the word changes. */
.word {
    margin: 0 0 8px;
    font-size: clamp(3rem, 14vw, 6.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #000000;
    overflow-wrap: anywhere;
    transition: opacity 0.6s ease;
}

.word.is-fading {
    opacity: 0;
}

.is-hidden {
    display: none !important;
}

/* Enter button: grey outline, fills grey on hover. */
.btn-enter {
    margin-top: 28px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: #333333;
    background: transparent;
    border: 1px solid #9ca3af;
    border-radius: 999px;
    cursor: pointer;
}

.btn-enter:hover,
.btn-enter:focus-visible {
    background: #6b7280;
    border-color: #6b7280;
    color: #ffffff;
    outline: none;
}

/* --- Overlay: the whole visitor flow, above the page --- */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.overlay[hidden] {
    display: none;
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.overlay-dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    max-height: calc(100svh - 40px);
    overflow-y: auto;
    padding: 28px 24px 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    text-align: left;
}

.overlay-dialog p {
    margin: 0 0 16px;
    color: #333333;
    text-align: center;
}

.overlay-close {
    position: absolute;
    top: 8px;
    right: 12px;
    padding: 4px 8px;
    font-size: 1.4rem;
    line-height: 1;
    color: #6b7280;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.overlay-close:hover,
.overlay-close:focus-visible {
    color: #111111;
    outline: none;
}

.overlay-step[hidden] {
    display: none;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111111;
}

.field input,
.field textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    color: #111111;
    background: #ffffff;
    border: 1px solid #9ca3af;
    border-radius: 8px;
}

.field input:focus,
.field textarea:focus {
    outline: 2px solid #111111;
    outline-offset: 1px;
}

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

.helper {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6b7280;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: #111111;
    border: 1px solid #111111;
    border-radius: 8px;
    cursor: pointer;
}

.btn-submit:hover,
.btn-submit:focus-visible {
    background: #374151;
    outline: none;
}

/* "Visit as Guest" / "Go to the Family Tree": same weight as the
   primary button, as a link underneath it. */
.btn-guest {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #111111;
    background: #ffffff;
    border: 1px solid #9ca3af;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn-guest:hover,
.btn-guest:focus-visible {
    background: #f3f4f6;
    outline: none;
}

.btn-back {
    padding: 0;
    font-size: 0.95rem;
    color: #333333;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.notice {
    width: 100%;
    max-width: 420px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: left;
}

.notice-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.notice-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #14532d;
}

.notice ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

/* Respect reduced-motion: no fade, word stays static. */
@media (prefers-reduced-motion: reduce) {
    .word {
        transition: none;
    }

    .word.is-fading {
        opacity: 1;
    }
}
