/* ==========================================================================
   Deusto Founders · ¿Más o menos?
   Same identity as deustofounders.com (ink, paper, Inter, the logo's pills),
   but a standalone, full-screen game.
   ========================================================================== */

@font-face {
    font-family: "Inter";
    src: url("/challenge/assets/fonts/inter.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --ink: #0e0e0e;
    --ink-soft: #1b1b1b;
    --paper: #f5f5f2;
    --white: #ffffff;
    --muted-dark: #5c5c5c;   /* secondary text on paper */
    --muted-light: #a3a3a3;  /* secondary text on ink */
    --line-dark: #2e2e2e;
    --line-light: #e5e5e1;
    --right: #2fbf71;
    --wrong: #e5484d;
    --gold: #e2b53e;
    --silver: #c3c7cf;
    --bronze: #cf8a55;

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --pill: 999px;
    --bar: 64px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--white);
    background: var(--ink);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "ss01", "cv11";
}

h1,
h2,
h3,
p,
ul,
ol {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Top bar ---------- */

.bar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: var(--bar);
    padding: 0 24px;
    pointer-events: none;
}

.bar > * {
    pointer-events: auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    text-decoration: none;
}

.brand svg {
    height: 30px;
    width: auto;
    fill: currentColor;
}

.brand span {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

body.is-playing .brand {
    color: var(--ink);
}

.bar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-height: 40px;
    padding: 9px 16px;
    border-radius: var(--pill);
    background: var(--ink-soft);
    color: var(--white);
    font-size: 0.9375rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.chip small {
    color: var(--muted-light);
    font-size: 0.8125rem;
    font-weight: 500;
}

.chip--timer.is-low {
    background: var(--wrong);
}

.chip--timer.is-low small {
    color: rgba(255, 255, 255, 0.8);
}

.chip--score.is-bumped {
    animation: bump 0.35s var(--ease);
}

@keyframes bump {
    40% { transform: scale(1.18); background: var(--right); }
}

.link-light {
    color: var(--white);
    font-weight: 600;
    text-decoration: none;
}

.link-light:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 30px;
    border: 1.5px solid transparent;
    border-radius: var(--pill);
    background: none;
    font-size: 1.0625rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease),
        transform 0.15s var(--ease);
}

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

.btn:disabled {
    cursor: default;
    opacity: 0.5;
}

.btn--light {
    background: var(--white);
    color: var(--ink);
}

.btn--light:hover {
    background: #e9e9e6;
}

.btn--dark {
    background: var(--ink);
    color: var(--white);
}

.btn--dark:hover {
    background: #262626;
}

.btn--ghost-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--white);
}

.btn--ghost-light:hover {
    border-color: var(--white);
}

.btn--ghost-dark {
    border-color: var(--line-light);
    color: var(--ink);
}

.btn--ghost-dark:hover {
    border-color: var(--ink);
}

.btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ==========================================================================
   Intro
   ========================================================================== */

.intro {
    position: relative;
    display: grid;
    align-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--bar) + 32px) 24px 48px;
    overflow: hidden;
}

.intro__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.intro__title {
    font-size: clamp(3.5rem, 11vw, 9.5rem);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.055em;
}

.intro__lead {
    max-width: 30ch;
    margin-top: 28px;
    color: var(--muted-light);
    font-size: clamp(1.1875rem, 2vw, 1.5rem);
    line-height: 1.4;
    letter-spacing: -0.015em;
}

.intro__lead strong {
    color: var(--white);
    font-weight: 600;
}

.rules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    max-width: 960px;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--line-dark);
}

.rules li {
    color: var(--muted-light);
    font-size: 0.9688rem;
    line-height: 1.55;
}

.rules strong {
    display: block;
    margin-bottom: 6px;
    color: var(--white);
    font-size: 1.0625rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.intro__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 24px;
    margin-top: 44px;
}

.intro__actions .btn--light {
    min-width: 200px;
    min-height: 64px;
    font-size: 1.1875rem;
}

.deadline {
    margin-top: 28px;
    color: var(--muted-light);
    font-size: 0.9375rem;
}

.deadline strong {
    color: var(--white);
    font-weight: 600;
}

.intro__foot {
    max-width: 70ch;
    margin-top: 56px;
    color: #6f6f6f;
    font-size: 0.8125rem;
    line-height: 1.55;
}

/* the logo's three pills, large, behind the title */
.intro__art {
    position: absolute;
    right: -6vw;
    bottom: -8vh;
    width: min(46vw, 620px);
    height: auto;
    fill: var(--ink-soft);
    pointer-events: none;
}

/* ==========================================================================
   Board: two halves, the known company on paper, the one to guess on ink
   ========================================================================== */

.board {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

.half {
    position: relative;
    display: grid;
    place-items: start center;
    /* both halves start at the same height, so the two logos and names line up */
    padding: calc(var(--bar) + clamp(24px, 14vh, 150px)) clamp(20px, 4vw, 56px) 56px;
    overflow: visible;
}

.half--known {
    background: var(--paper);
    color: var(--ink);
}

.half--guess {
    background: var(--ink);
    color: var(--white);
}

/* the old and new companies overlap in the same spot while they slide */
.half > .company {
    grid-area: 1 / 1;
}

.company {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 560px;
    text-align: center;
    transition: color 0.42s var(--ease);
}

.company__logo {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    margin-bottom: 22px;
    padding: 16px;
    border-radius: 28px;
    background: var(--white);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.company__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* no logo: the company's initials */
.company__logo--letters {
    color: var(--ink);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.company__name {
    font-size: clamp(1.75rem, 3.4vw, 3rem);
    font-weight: 750;
    line-height: 1.05;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.company__about {
    margin-top: 10px;
    font-size: 1rem;
    line-height: 1.45;
    opacity: 0.62;
}

.company__worth {
    margin-top: clamp(24px, 5vh, 44px);
    font-size: 1rem;
    opacity: 0.62;
}

.company__value {
    --chars: 15;
    margin-top: 4px;
    font-size: clamp(1.75rem, calc(72vw / var(--chars)), 5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.company__words {
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.company__source {
    margin-top: 4px;
    font-size: 0.875rem;
    opacity: 0.55;
}

.company__ask {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.company__question {
    margin-top: clamp(24px, 5vh, 44px);
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 650;
    letter-spacing: -0.02em;
}

.company__question small {
    display: block;
    margin-top: 2px;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0;
    opacity: 0.62;
}

.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: min(100%, 380px);
    margin-top: 22px;
}

.choices .btn {
    min-height: 64px;
    font-size: 1.1875rem;
}

.half--guess .choices .btn--ghost-light {
    border-color: rgba(255, 255, 255, 0.35);
}

.shortcuts {
    margin-top: 16px;
    font-size: 0.8125rem;
    opacity: 0.45;
}

/* the right-hand company turns dark-on-paper as it slides across */
.company.is-crossing {
    color: var(--ink);
}

.company.is-crossing .company__logo {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* ---------- The pill on the seam: vs, then ✓ or ✗ ---------- */

.seam {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 64px;
    height: 96px;
    border-radius: 36px;
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 0 0 6px var(--ink), 0 0 0 7px rgba(255, 255, 255, 0.08);
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    transform: translate(-50%, -50%);
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.seam svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.seam.is-right {
    background: var(--right);
    color: var(--white);
    animation: pop 0.38s var(--ease);
}

.seam.is-wrong {
    background: var(--wrong);
    color: var(--white);
    animation: pop 0.38s var(--ease);
}

@keyframes pop {
    0% { transform: translate(-50%, -50%) scale(0.7); }
    60% { transform: translate(-50%, -50%) scale(1.12); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.half--guess.is-wrong .company {
    animation: shake 0.42s var(--ease);
}

@keyframes shake {
    20% { transform: translateX(-10px); }
    40% { transform: translateX(9px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(3px); }
}

/* ---------- Time left: a pill-shaped track along the bottom ---------- */

.clock {
    position: absolute;
    right: 24px;
    bottom: 22px;
    left: 24px;
    z-index: 6;
    height: 8px;
    border-radius: var(--pill);
    background: rgba(127, 127, 127, 0.22);
    overflow: hidden;
}

.clock span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--muted-dark);
    transform-origin: left center;
}

.clock.is-low span {
    background: var(--wrong);
}

.notice {
    position: absolute;
    bottom: 44px;
    left: 50%;
    z-index: 7;
    padding: 10px 18px;
    border-radius: var(--pill);
    background: var(--white);
    color: var(--ink);
    font-size: 0.9375rem;
    font-weight: 600;
    transform: translateX(-50%);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   End of game
   ========================================================================== */

.result {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(14, 14, 14, 0.72);
    overflow-y: auto;
    animation: fade 0.25s var(--ease);
}

@keyframes fade {
    from { opacity: 0; }
}

.result__sheet {
    width: min(100%, 560px);
    padding: 40px;
    border-radius: 36px;
    background: var(--paper);
    color: var(--ink);
    animation: rise 0.35s var(--ease);
}

@keyframes rise {
    from { transform: translateY(24px); }
}

.result__title:focus {
    outline: none;
}

.result__title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.result__score {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 10px;
}

.result__score strong {
    font-size: clamp(4.5rem, 16vw, 7rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.06em;
    font-variant-numeric: tabular-nums;
}

.result__score span {
    color: var(--muted-dark);
    font-size: 1.25rem;
    font-weight: 600;
}

.result__why {
    margin-top: 14px;
    color: var(--muted-dark);
    font-size: 1rem;
    line-height: 1.5;
}

.result__why strong {
    color: var(--ink);
    font-weight: 600;
}

.send {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line-light);
}

.send__title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.send__rule {
    margin-top: 6px;
    color: var(--muted-dark);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.send__rule strong {
    color: var(--ink);
}

.field {
    display: grid;
    gap: 6px;
    margin-top: 18px;
}

.field label {
    font-size: 0.9375rem;
    font-weight: 600;
}

.field input {
    width: 100%;
    min-height: 54px;
    padding: 12px 18px;
    border: 1.5px solid var(--line-light);
    border-radius: 16px;
    background: var(--white);
    font-size: 1rem;
}

.field input:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 4px rgba(14, 14, 14, 0.08);
}

.check {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    margin-top: 14px;
    color: var(--muted-dark);
    font-size: 0.9063rem;
    line-height: 1.45;
}

.check input {
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--ink);
}

.check a {
    color: var(--ink);
}

.send__error {
    margin-top: 12px;
    color: #b42318;
    font-size: 0.9375rem;
    font-weight: 600;
}

.send .btn--dark {
    width: 100%;
    margin-top: 18px;
}

.send__done {
    margin-top: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--ink);
    color: var(--white);
    font-weight: 600;
}

.result__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-top: 24px;
}

.result__actions .btn {
    min-height: 50px;
    padding: 0 24px;
    font-size: 1rem;
}

.link-dark {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.link-dark:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* ==========================================================================
   Phones: the halves stack
   ========================================================================== */

@media (max-width: 760px) {
    :root {
        --bar: 58px;
    }

    .bar {
        padding: 0 14px;
    }

    .brand span {
        display: none;
    }

    .chip {
        min-height: 36px;
        padding: 7px 13px;
    }

    .rules {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-top: 36px;
    }

    .intro__actions .btn--light {
        flex: 1 1 100%;
    }

    .intro__art {
        width: 80vw;
        right: -24vw;
        bottom: -6vh;
    }

    .board {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }

    .half {
        place-items: center;
        padding: 12px 18px;
    }

    .half--known {
        padding-top: calc(var(--bar) + 4px);
    }

    .half--guess {
        padding-bottom: 36px;
    }

    .company__logo {
        width: 64px;
        height: 64px;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 20px;
    }

    .company__logo--letters {
        font-size: 1.375rem;
    }

    .company__name {
        font-size: 1.625rem;
    }

    .company__about {
        margin-top: 4px;
        font-size: 0.875rem;
    }

    .company__worth,
    .company__question {
        margin-top: 12px;
    }

    .company__worth {
        font-size: 0.875rem;
    }

    .company__value {
        font-size: clamp(1.375rem, calc(150vw / var(--chars)), 3rem);
    }

    .company__words {
        margin-top: 6px;
        font-size: 0.875rem;
    }

    .company__source {
        font-size: 0.75rem;
    }

    .company__question {
        font-size: 1.125rem;
    }

    .company__question small {
        font-size: 0.875rem;
    }

    .choices {
        margin-top: 12px;
    }

    .choices .btn {
        min-height: 54px;
    }

    .shortcuts {
        display: none;
    }

    .seam {
        width: 84px;
        height: 52px;
        font-size: 1rem;
    }

    .seam svg {
        width: 22px;
        height: 22px;
    }

    .clock {
        right: 14px;
        bottom: 14px;
        left: 14px;
        height: 6px;
    }

    .result__sheet {
        padding: 28px 22px;
        border-radius: 28px;
    }
}

@media (max-width: 760px) and (max-height: 700px) {
    .company__logo {
        display: none;
    }
}

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