/* ==========================================================================
   BingeWords landing — dark cinematic theme.
   No build step: plain CSS, system fonts, mobile-first.
   ========================================================================== */

:root {
    --bg: #0a0c10;              /* the dark room */
    --surface: #12151b;         /* player chrome */
    --surface-2: #191d26;
    --line: #232936;
    --text: #eef1f6;
    --muted: #97a1b2;
    --yellow: #ffd633;          /* classic subtitle yellow */
    --yellow-deep: #f2c500;
    --green: #5ed488;           /* "learned word" green */
    --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
    --radius: 14px;
    --shadow-pop: 0 18px 50px rgba(0, 0, 0, .5);
}

/* ---------- Base ---------------------------------------------------------- */

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

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; }

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

:focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection { background: rgba(255, 214, 51, .28); }

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

.container {
    width: 100%;
    max-width: 1060px;
    margin-inline: auto;
    padding-inline: 20px;
}

.container-narrow { max-width: 760px; }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55em;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: .72em 1.35em;
    cursor: pointer;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--yellow);
    color: #14120a;
    box-shadow: 0 6px 24px rgba(255, 214, 51, .18);
}

.btn-primary:hover {
    background: var(--yellow-deep);
    box-shadow: 0 8px 30px rgba(255, 214, 51, .28);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

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

.btn-lg { padding: .85em 1.6em; font-size: 1.06rem; }
.btn-sm { padding: .5em 1em; font-size: .92rem; border-radius: 10px; }

.btn-icon {
    width: 1.25em;
    height: 1.25em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

/* ---------- Header (top letterbox bar) ------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 12, 16, .78);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.site-header.is-scrolled {
    border-bottom-color: var(--line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 62px;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    border-radius: 8px;
}

.logo-img {
    display: block;
    height: 30px;
    width: auto;
}

.site-nav {
    display: none;
    gap: 26px;
    margin-inline: auto;
}

.site-nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: .95rem;
    font-weight: 500;
    transition: color .15s ease;
}

.site-nav a:hover { color: var(--yellow); }

.header-inner > .btn { margin-left: auto; }

@media (min-width: 780px) {
    .site-nav { display: flex; }
    .header-inner > .btn { margin-left: 0; }
}

/* ---------- Hero ----------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 84px 0 72px;
    text-align: center;
}

.hero-glow {
    position: absolute;
    inset: -40% -20% auto;
    height: 130%;
    background:
        radial-gradient(52% 46% at 50% 34%, rgba(255, 214, 51, .09), transparent 70%),
        radial-gradient(70% 60% at 50% 0%, rgba(64, 92, 150, .16), transparent 70%);
    pointer-events: none;
}

.hero-inner { position: relative; }

.hero-eyebrow {
    display: inline-block;
    font: 600 .78rem/1 var(--mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .65em 1.1em;
    margin-bottom: 28px;
}

.hero-title {
    font-size: clamp(2.35rem, 7.2vw, 4.3rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.hero-title-line { display: block; }

/* The second line is typeset like a video subtitle: yellow + shadow */
.hero-title-accent {
    color: var(--yellow);
    text-shadow: 0 3px 0 rgba(0, 0, 0, .85), 0 0 34px rgba(255, 214, 51, .22);
}

.hero-subtitle {
    max-width: 620px;
    margin: 24px auto 0;
    color: var(--muted);
    font-size: 1.08rem;
    text-wrap: pretty;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 36px;
}

.hero-note {
    margin-top: 18px;
    font-size: .88rem;
    color: var(--muted);
}

@media (min-width: 780px) {
    .hero { padding: 116px 0 96px; }
}

/* ---------- Sections ------------------------------------------------------- */

.section {
    padding: 72px 0;
    border-top: 1px solid var(--line);
    scroll-margin-top: 70px;
}

@media (min-width: 780px) {
    .section { padding: 96px 0; }
}

/* Eyebrow styled as a player timecode — the page reads as a timeline */
.timecode {
    font: 600 .8rem/1 var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

.timecode-mark { color: var(--yellow); margin-right: .6em; }

.section-title {
    font-size: clamp(1.65rem, 4.4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    text-wrap: balance;
    max-width: 640px;
}

.section-subtitle {
    margin-top: 14px;
    color: var(--muted);
    max-width: 560px;
    text-wrap: pretty;
}

/* ---------- Steps (filmstrip frames) --------------------------------------- */

.steps {
    display: grid;
    gap: 16px;
    margin-top: 44px;
}

.step {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px 28px;
    transition: border-color .2s ease, transform .2s ease;
}

.step:hover { border-color: rgba(255, 214, 51, .45); transform: translateY(-3px); }

.step-time {
    position: absolute;
    top: 18px;
    right: 20px;
    font: 600 .74rem/1 var(--mono);
    letter-spacing: .1em;
    color: var(--muted);
    opacity: .75;
}

.step-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 13px;
    background: rgba(255, 214, 51, .09);
    margin-bottom: 18px;
}

.step-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: var(--yellow);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.step-title {
    font-size: 1.22rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.step-text { color: var(--muted); font-size: .97rem; }

@media (min-width: 720px) {
    .steps { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}

/* ---------- Demo player ----------------------------------------------------- */

.player {
    max-width: 840px;
    margin: 44px auto 0;
    background: #07080b;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: visible;             /* the tooltip may poke above the frame */
    box-shadow: var(--shadow-pop);
}

.player-screen {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 15px 15px 0 0;
    overflow: visible;
}

/* A "movie frame": cool night scene with a warm practical light */
.scene {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    background:
        radial-gradient(60% 55% at 72% 30%, rgba(255, 171, 64, .17), transparent 65%),
        radial-gradient(80% 70% at 22% 68%, rgba(56, 96, 165, .28), transparent 70%),
        linear-gradient(180deg, #10141c 0%, #0c0f15 55%, #07080b 100%);
}

/* Letterbox bars + vignette inside the frame */
.scene::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .85) 0, transparent 8%, transparent 92%, rgba(0, 0, 0, .85) 100%),
        radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}

.subtitle-line {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 10%;
    text-align: center;
    font-weight: 700;
    font-size: clamp(.95rem, 2.7vw, 1.45rem);
    line-height: 1.45;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .95), 0 0 14px rgba(0, 0, 0, .6);
}

.demo-word-wrap { position: relative; display: inline-block; }

/* The clickable word: yellow underline, like in the extension */
.demo-word {
    font: inherit;
    color: inherit;
    text-shadow: inherit;
    background: transparent;
    border: 0;
    padding: 0 3px;
    margin: 0;
    cursor: pointer;
    border-bottom: 3px solid var(--yellow);
    border-radius: 4px 4px 0 0;
    transition: background-color .15s ease, border-color .15s ease;
}

.demo-word:hover { background: rgba(255, 214, 51, .16); }

.demo-word.is-saved { border-bottom-color: var(--green); }

/* Gentle pulse invites the click (until saved) */
@keyframes word-pulse {
    0%, 100% { box-shadow: 0 3px 0 0 rgba(255, 214, 51, 0); }
    50%      { box-shadow: 0 3px 10px 0 rgba(255, 214, 51, .45); }
}

.demo-word:not(.is-saved) { animation: word-pulse 2.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
    .demo-word { animation: none !important; }
}

/* Tooltip — the extension card: dark, radius 12, above the word */
.tooltip {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(285px, 78vw);
    background: #171b23;
    border: 1px solid #2b3242;
    border-radius: 12px;
    padding: 13px 15px 12px;
    text-align: left;
    font-weight: 400;
    font-size: .9rem;
    line-height: 1.45;
    text-shadow: none;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
    z-index: 5;
    animation: tip-in .15s ease-out;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #171b23;
}

@keyframes tip-in {
    from { opacity: 0; transform: translateX(-50%) translateY(5px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .tooltip { animation: none; }
}

/* On narrow screens anchor the tooltip to the subtitle line (centered in the
   player) so it can't hang off the viewport when the word sits near an edge. */
@media (max-width: 599px) {
    .demo-word-wrap { position: static; }
    .tooltip { max-width: calc(100vw - 56px); }
    .tooltip::after { display: none; }
}

.tooltip-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.tooltip-word { font-size: 1.05rem; font-weight: 700; color: var(--yellow); }
.tooltip-ipa { color: var(--muted); font-size: .85rem; }

.tooltip-pos {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 2px 6px;
}

.tooltip-translation { margin-top: 7px; color: var(--text); }

.tooltip-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 11px;
}

.tooltip-add {
    font: 700 .86rem/1 inherit;
    font-family: inherit;
    color: #14120a;
    background: var(--yellow);
    border: 0;
    border-radius: 8px;
    padding: 8px 13px;
    cursor: pointer;
    transition: background-color .15s ease;
}

.tooltip-add:hover { background: var(--yellow-deep); }

.tooltip-add.is-done {
    background: var(--green);
    cursor: default;
}

.tooltip-phrase {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s ease;
}

.tooltip-phrase:hover { border-color: var(--yellow); }

.tooltip-phrase svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.6;
}

/* Player control bar */
.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-radius: 0 0 15px 15px;
}

.pc-play svg, .pc-gear svg {
    width: 20px;
    height: 20px;
}

.pc-play svg { fill: #cdd4e0; }

.pc-gear svg {
    fill: none;
    stroke: #8a93a5;
    stroke-width: 1.5;
}

.pc-progress {
    position: relative;
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: #2a303c;
    overflow: hidden;
}

.pc-buffered {
    position: absolute;
    inset: 0 45% 0 0;
    background: #3d4554;
}

.pc-played {
    position: absolute;
    inset: 0 70% 0 0;
    background: var(--yellow);
}

.pc-time {
    font: 500 .72rem/1 var(--mono);
    color: var(--muted);
    white-space: nowrap;
}

.pc-cc {
    font: 800 .62rem/1 var(--mono);
    color: #14120a;
    background: var(--yellow);
    border-radius: 4px;
    padding: 4px 5px;
}

.demo-caption {
    max-width: 560px;
    margin: 22px auto 0;
    text-align: center;
    color: var(--muted);
    font-size: .93rem;
}

/* ---------- Pricing ---------------------------------------------------------- */

.plans {
    display: grid;
    gap: 16px;
    max-width: 640px;
    margin-top: 44px;
}

.plan {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}

.plan-featured {
    border-color: rgba(255, 214, 51, .55);
    background: linear-gradient(180deg, rgba(255, 214, 51, .06), rgba(255, 214, 51, 0) 60%), var(--surface);
}

.plan-badge {
    position: absolute;
    top: -11px;
    right: 18px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #14120a;
    background: var(--yellow);
    border-radius: 999px;
    padding: 4px 11px;
}

.plan-name {
    font: 600 .8rem/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
}

.plan-price {
    margin-top: 12px;
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.plan-period {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
    margin-left: 4px;
}

.plan-note { margin-top: 6px; font-size: .88rem; color: var(--green); }

@media (min-width: 640px) {
    .plans { grid-template-columns: 1fr 1.2fr; align-items: stretch; }
}

.pricing-trial {
    margin-top: 18px;
    font-size: .92rem;
    color: var(--muted);
}

.pricing-trial::before {
    content: "\2726";           /* ✦ */
    color: var(--yellow);
    margin-right: .55em;
}

/* Comparison table */
.table-scroll {
    position: relative;   /* contains the absolutely-positioned .sr-only helpers */
    margin-top: 40px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.compare {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: .95rem;
}

.compare th, .compare td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.compare tbody tr:last-child th,
.compare tbody tr:last-child td { border-bottom: 0; }

.compare thead th {
    font: 600 .78rem/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    background: var(--surface-2);
}

.compare thead .col-pro { color: var(--yellow); }

.compare tbody th {
    font-weight: 500;
    color: var(--text);
}

.compare .col-free, .compare .col-pro {
    width: 22%;
    min-width: 128px;
    color: var(--muted);
    white-space: nowrap;
}

.compare td.col-pro { background: rgba(255, 214, 51, .045); color: var(--text); }

.compare .check {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: var(--green);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.compare td.col-pro .check { stroke: var(--yellow); }

.compare .dash { color: #57607190; }

.pricing-regional {
    margin-top: 16px;
    font-size: .85rem;
    color: var(--muted);
}

.pricing-cta { margin-top: 32px; }

/* ---------- FAQ --------------------------------------------------------------- */

.faq-list { margin-top: 36px; }

.faq-item {
    border-bottom: 1px solid var(--line);
}

.faq-item summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 19px 2px;
    font-weight: 600;
    font-size: 1.02rem;
    cursor: pointer;
    transition: color .15s ease;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary:hover { color: var(--yellow); }

.faq-item summary::after {
    content: "+";
    flex: none;
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
    color: var(--muted);
    transition: transform .2s ease, color .2s ease;
}

.faq-item[open] summary { color: var(--yellow); }

.faq-item[open] summary::after {
    transform: rotate(45deg);
    color: var(--yellow);
}

.faq-item p {
    padding: 0 2px 20px;
    color: var(--muted);
    max-width: 640px;
}

/* ---------- Footer (end credits) ----------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 64px 0 44px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg), #07080b);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
}

.footer-logo img {
    display: block;
    height: 28px;
    width: auto;
}

.footer-tagline { color: var(--muted); font-size: .95rem; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 26px;
    margin-top: 8px;
}

.footer-links a {
    color: var(--muted);
    font-size: .9rem;
    text-decoration: none;
    transition: color .15s ease;
}

.footer-links a:hover { color: var(--yellow); }

.footer-disclaimer {
    max-width: 560px;
    margin-top: 14px;
    font-size: .78rem;
    color: #6a7383;
}

.footer-copy {
    font: 500 .74rem/1.5 var(--mono);
    letter-spacing: .06em;
    color: #6a7383;
    margin-top: 4px;
}

/* ---------- Scroll reveal -------------------------------------------------------- */

.js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .55s ease, transform .55s ease;
}

.js .reveal.in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- Legal pages ------------------------------------------------------------ */

.legal {
    max-width: 720px;
    margin-inline: auto;
    padding: 56px 20px 80px;
}

.legal h1 {
    font-size: clamp(1.7rem, 4.5vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 8px;
}

.legal .legal-updated {
    font: 500 .8rem/1 var(--mono);
    color: var(--muted);
    margin-bottom: 36px;
}

.legal h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 34px 0 10px;
}

.legal p, .legal li { color: var(--muted); }

.legal ul { margin: 10px 0; padding-left: 22px; }

.legal a { color: var(--yellow); }

.legal .legal-back {
    display: inline-block;
    margin-bottom: 36px;
    font-size: .9rem;
    color: var(--muted);
    text-decoration: none;
}

.legal .legal-back:hover { color: var(--yellow); }
