/*
 * Together2stars.com: the look of the bridge to the Two In Play app (the home page and the legal documents).
 *
 * Hand-written, loaded only by resources/views/app/bridge-layout.blade.php. Those pages do not load the Tailwind
 * build (app.css), so every class used there is defined here.
 *
 * The look is meant to differ from twoinplay.com (cream bands, dusty rose, italic serif headings): a light grey
 * page with soft yellow patches, bold sans-serif headings and only two colours, chosen by the owners: the yellow of
 * the stars the old game was named after and a wine red. Every other tone (text, lines, shadows, the grey of the
 * page) is a shade of that wine red; the logo is a dark yellow.
 * No web font is loaded: headings use the rounded system face where the device has one.
 * Only the stars move; nothing else is animated.
 */

:root {
    --bg: #F2EFF1;
    --band: #FFF4CF;
    --card: #FFFFFF;
    --line: #E4DCE1;
    --ink: #3B162F;
    --text: #614C5A;
    --muted: #74616D;
    --wine: #C24398;
    --sun: #FFC93C;
    --sun-soft: #FFF0BF;
    --sun-deep: #D39C00;
    --display: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --shadow: 0 20px 44px -22px rgba(59, 22, 47, .30);
    /* four-pointed star, used as a mask so that each star takes its colour from its background */
    --spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c.9 6.2 5.8 11.1 12 12-6.2.9-11.1 5.8-12 12-.9-6.2-5.8-11.1-12-12 6.2-.9 11.1-5.8 12-12z'/%3E%3C/svg%3E");
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); }
img { max-width: 100%; height: auto; }
a { color: var(--wine); }
a:focus-visible { outline: 3px solid var(--wine); outline-offset: 3px; border-radius: 6px; }
strong { color: var(--ink); font-weight: 700; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* the only class taken over from the Tailwind build: shared translations carry it in their markup */
.whitespace-nowrap { white-space: nowrap; }

/* decorative star */
.spark {
    position: absolute;
    width: 22px;
    height: 22px;
    background: var(--sun);
    -webkit-mask: var(--spark) center / contain no-repeat;
    mask: var(--spark) center / contain no-repeat;
    pointer-events: none;
}

/* wine red text of the accents in the headings */
.accent { color: var(--wine); }

/* ---- header --------------------------------------------------------------------------------------------------- */

.site-head {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(242, 239, 241, .88);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-family: var(--display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1;
    text-decoration: none;
}
.logo b { color: var(--sun-deep); font-weight: inherit; }
.logo small { font-size: .9em; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color .2s;
}
.site-nav a:hover, .site-nav a[aria-current] { background: var(--sun-soft); }
/* the logo leads to the home page too, so a narrow screen can do without the link */
@media (max-width: 479px) { .site-nav .nav-home { display: none; } }
/* the narrowest phones: the logo and the link still fit side by side */
@media (max-width: 359px) {
    .logo { font-size: 1.05rem; }
    .site-nav a { padding: 7px 10px; }
}

/* ---- page background: soft yellow patches of various sizes down the page ---------------------------------------- */

/* Each patch is a radial gradient: width (never wider than a part of the window) and height, then its place across
   and down the content. The first one is the glow in the top right corner. */
main {
    position: relative;
    background:
        radial-gradient(min(560px, 80vw) 420px at 92% 40px, rgba(255, 201, 60, .34), transparent 70%),
        radial-gradient(min(380px, 60vw) 300px at 3% 13%, rgba(255, 214, 92, .22), transparent 70%),
        radial-gradient(min(300px, 50vw) 240px at 72% 24%, rgba(255, 201, 60, .16), transparent 70%),
        radial-gradient(min(340px, 55vw) 440px at 98% 37%, rgba(255, 190, 40, .20), transparent 70%),
        radial-gradient(min(440px, 65vw) 320px at 6% 47%, rgba(255, 214, 92, .20), transparent 70%),
        radial-gradient(min(260px, 45vw) 260px at 60% 61%, rgba(255, 201, 60, .14), transparent 70%),
        radial-gradient(min(420px, 65vw) 340px at 2% 70%, rgba(255, 190, 40, .20), transparent 70%),
        radial-gradient(min(320px, 55vw) 300px at 95% 79%, rgba(255, 214, 92, .22), transparent 70%),
        radial-gradient(min(520px, 75vw) 280px at 28% 98%, rgba(255, 201, 60, .18), transparent 70%);
    background-repeat: no-repeat;
}

/* ---- hero ----------------------------------------------------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 48px 0 64px;
}
.hero-grid { display: grid; gap: 44px; align-items: center; }
.hero-text { text-align: center; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: var(--sun-soft);
    color: var(--ink);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.5;
}
.eyebrow::before {
    content: "";
    width: 14px;
    height: 14px;
    background: var(--wine);
    -webkit-mask: var(--spark) center / contain no-repeat;
    mask: var(--spark) center / contain no-repeat;
}

.hero h1 {
    margin-top: 18px;
    font-size: clamp(2rem, 9.5vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
}
/* yellow marker under the last word ... */
.hero h1 mark {
    position: relative;
    display: inline-block;
    padding: 0 .06em;
    margin: 0 -.06em;
    background: linear-gradient(transparent 62%, var(--sun) 62%, var(--sun) 92%, transparent 92%);
    color: inherit;
}
/* ... and a star above its end */
.hero h1 mark::after {
    content: "";
    position: absolute;
    top: -.2em;
    right: -.46em;
    width: .42em;
    height: .42em;
    background: var(--sun);
    -webkit-mask: var(--spark) center / contain no-repeat;
    mask: var(--spark) center / contain no-repeat;
}
.hero-sub {
    margin-top: 6px;
    font-family: var(--display);
    font-size: clamp(1.5rem, 6vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.lead { font-size: 1.1875rem; line-height: 1.6; }
.lead a { font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.lead .pop { color: var(--wine); }
/* the gap above the first paragraph looks the same as the gap under it */
.hero .lead { margin-top: 28px; }
.hero-sub + .lead { margin-top: 32px; }
.hero .badges { margin-top: 30px; }

.badges { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 18px; }
.badges a { display: block; border-radius: 10px; }
.badges img { display: block; }
.badges p { font-size: 1rem; }

.hero-visual { position: relative; z-index: 0; display: grid; place-items: center; }
/* soft yellow shape behind the phone */
.hero-visual::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: min(400px, 86%);
    aspect-ratio: 1;
    border-radius: 47% 53% 60% 40% / 45% 48% 52% 55%;
    background: linear-gradient(140deg, #FFEBA6 0%, #FFCF4F 100%);
}
.hero-phone { width: 320px; max-width: 78%; filter: drop-shadow(0 26px 28px rgba(59, 22, 47, .20)); }
.hero-visual .spark:nth-of-type(1) { top: 2%; left: 10%; width: 30px; height: 30px; }
.hero-visual .spark:nth-of-type(2) { top: 30%; right: 4%; width: 18px; height: 18px; }
.hero-visual .spark:nth-of-type(3) { bottom: 6%; left: 4%; width: 20px; height: 20px; }

@media (min-width: 960px) {
    .hero { padding: 72px 0 88px; }
    .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 56px; }
    .hero-text { text-align: left; }
    .hero-text .badges { justify-content: flex-start; }
    .lead { font-size: 1.25rem; }
}

/* ---- sections ------------------------------------------------------------------------------------------------- */

.section { padding: 64px 0; }
.section h2 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    text-align: center;
}
.section-lead { max-width: 46rem; margin: 20px auto 0; text-align: center; }

/* a tinted panel with rounded corners, a little narrower than the window */
.band { margin: 0 12px; border-radius: 36px; background: var(--band); }

@media (min-width: 768px) {
    .section { padding: 88px 0; }
    .band { margin: 0 24px; border-radius: 48px; }
}

/* ---- how the game is played: four screens of the app ---------------------------------------------------------- */

.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 16px; margin-top: 44px; }
.shot { text-align: center; }
/* the screenshots have square corners: the frame turns each into a phone, in the colours of the phone in the hero
   picture (its cream body and darker edge) */
.shot-frame {
    display: block;
    max-width: 252px;
    margin: 0 auto;
    padding: 6px;
    border: 2px solid #C5B9AD;
    border-radius: 30px;
    background: #F1E4D8;
    box-shadow: var(--shadow);
}
.shot-frame img { display: block; width: 100%; border-radius: 22px; }
.shot figcaption { margin-top: 18px; color: var(--ink); font-weight: 600; line-height: 1.45; }

@media (min-width: 640px) {
    .shots { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
}

@media (min-width: 900px) {
    .shots { gap: 28px; }
    /* a slight tilt, fixed: the phones do not react to the pointer */
    .shot:nth-child(odd) .shot-frame { transform: rotate(-2.5deg); }
    .shot:nth-child(even) .shot-frame { transform: rotate(2.5deg); }
}

/* ---- what is different: six cards ----------------------------------------------------------------------------- */

.cards { display: grid; gap: 16px; margin-top: 44px; }
/* on a phone the icon stands beside the text, which keeps the six cards short */
.card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    padding: 20px;
    border-radius: 24px;
    background: var(--card);
    box-shadow: var(--shadow);
}
.card-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #FFE9A6;
    color: var(--wine);
}
.card-icon svg { width: 26px; height: 26px; }
/* each card has its own colour, all of them tints of the yellow and of the wine red, taking turns */
.card:nth-child(2) .card-icon { background: #F3D2E7; }
.card:nth-child(3) .card-icon { background: var(--sun); color: var(--ink); }
.card:nth-child(4) .card-icon { background: #E3A9CF; color: var(--ink); }
.card:nth-child(5) .card-icon { background: var(--sun-soft); }
.card:nth-child(6) .card-icon { background: var(--wine); color: #FFFFFF; }

/* a box under the pointer is highlighted by a yellow outline, a deeper shadow and its heading in wine red;
   it does not move */
.card, .faq-item { transition: box-shadow .15s, border-color .15s; }
.card strong, .faq-item h3 { transition: color .15s; }
.card:hover strong, .faq-item:hover h3 { color: var(--wine); }
.card:hover { box-shadow: 0 0 0 3px var(--sun), 0 24px 48px -20px rgba(59, 22, 47, .42); }
.faq-item:hover { border-color: var(--sun); box-shadow: 0 0 0 2px var(--sun), 0 24px 48px -20px rgba(59, 22, 47, .42); }
.card strong { display: block; margin-bottom: 6px; font-family: var(--display); font-size: 1.1875rem; line-height: 1.3; }

@media (min-width: 640px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    .card { display: block; padding: 24px; }
    .card-icon { margin-bottom: 16px; }
}
@media (min-width: 980px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }

/* ---- questions ------------------------------------------------------------------------------------------------ */

.faq { display: grid; gap: 16px; max-width: 940px; margin: 44px auto 0; }
.faq-item { padding: 22px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.faq-item h3 { margin-bottom: 8px; font-size: 1.1875rem; font-weight: 700; line-height: 1.35; }
.faq-item a { font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }

@media (min-width: 800px) { .faq { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }

/* ---- closing invitation --------------------------------------------------------------------------------------- */

.section-cta { padding-top: 0; }
.cta {
    position: relative;
    z-index: 0;
    overflow: hidden;
    margin: 0 12px;
    padding: 56px 0;
    border-radius: 36px;
    background: linear-gradient(135deg, #FFE27A 0%, #FFC93C 100%);
    color: var(--ink);
    text-align: center;
}
.cta .lead { margin-top: 16px; }
.cta .badges { margin-top: 28px; }
.cta-more { margin-top: 22px; }
.cta-more a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.cta .spark { z-index: -1; background: rgba(255, 255, 255, .75); }
/* a phone has room for two stars in the corners, a wider screen for all four */
.cta .spark:nth-of-type(1) { top: 18px; left: 18px; width: 24px; height: 24px; }
.cta .spark:nth-of-type(2), .cta .spark:nth-of-type(3) { display: none; }
.cta .spark:nth-of-type(4) { right: 16px; bottom: 16px; width: 28px; height: 28px; }
.store-note { max-width: 46rem; margin: 28px auto 0; color: var(--muted); font-size: .875rem; line-height: 1.5; text-align: center; }

@media (min-width: 768px) {
    .cta { margin: 0 24px; padding: 72px 0; border-radius: 48px; }
    .cta .spark:nth-of-type(1) { top: 16%; left: 7%; width: 34px; height: 34px; }
    .cta .spark:nth-of-type(2) { display: block; bottom: 14%; left: 16%; width: 18px; height: 18px; }
    .cta .spark:nth-of-type(3) { display: block; top: 22%; right: 9%; width: 24px; height: 24px; }
    .cta .spark:nth-of-type(4) { right: 5%; bottom: 18%; width: 40px; height: 40px; }
}

/* ---- legal documents ------------------------------------------------------------------------------------------ */

.legal { padding: 32px 0 72px; }
.prose {
    max-width: 860px;
    margin: 0 auto;
    padding: 28px 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--card);
    -webkit-user-select: none;
    user-select: none;
}
.prose h1 { margin: 0 0 24px; font-size: clamp(1.75rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.prose h2, .prose h3 { margin: 1.6em 0 .6em; line-height: 1.3; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.4em; }
/* the documents number their parts as one-item lists: show those as headings of the parts */
.prose ol { margin-top: 1.8em; color: var(--ink); font-family: var(--display); font-size: 1.1875rem; font-weight: 700; line-height: 1.35; }
.prose li { margin-bottom: .4em; }
.prose li p { margin-bottom: .4em; }
.prose a { font-weight: 600; text-underline-offset: 3px; }
.prose > :last-child { margin-bottom: 0; }

@media (min-width: 640px) {
    .legal { padding: 48px 0 88px; }
    .prose { padding: 40px 44px; }
}

/* ---- footer --------------------------------------------------------------------------------------------------- */

.site-foot { margin-top: auto; border-top: 1px solid var(--line); background: #EAE6E9; font-size: 1rem; }
.foot-grid { display: grid; gap: 24px; padding: 36px 0 28px; }
.foot-about .logo { margin-bottom: 14px; }
.foot-nav { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px 26px; }
.foot-nav a { color: var(--ink); font-weight: 600; text-decoration: none; }
.foot-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot-copy { padding: 16px 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; text-align: center; }

@media (min-width: 800px) {
    .foot-grid { grid-template-columns: 1fr auto; padding: 44px 0 36px; }
    .foot-nav { padding-top: 6px; }
}

/* ---- back to the top: appears below the first screen and stops above the footer ------------------------------- */

.to-top-rail { position: absolute; top: 100vh; right: 16px; bottom: 16px; z-index: 10; width: 44px; pointer-events: none; }
.to-top {
    position: sticky;
    top: calc(100vh - 64px);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--wine);
    box-shadow: var(--shadow);
    pointer-events: auto;
}
.to-top svg { width: 22px; height: 22px; }

/* ---- motion: only the stars twinkle, and only for visitors who have not asked their device to reduce motion ---- */

@media (prefers-reduced-motion: no-preference) {
    .spark { animation: twinkle 3.6s ease-in-out infinite; }
    .spark:nth-of-type(2n) { animation-delay: -1.2s; }
    .spark:nth-of-type(3n) { animation-delay: -2.4s; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

@keyframes twinkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(.72); opacity: .6; }
}
