/* =====================================================================
   enisnews — launch splash, welcome intro and the feed's masthead
   The splash and the welcome use the base palette (app.css), whose
   accent is the logo's own gradient; the feed is a news-mode screen.
   ===================================================================== */

:root {
  /* the logo's colours: the accent changes on the reading screens, the logo never does */
  --logo-grad: linear-gradient(135deg, #6d5bff 0%, #9b5cff 52%, #e0529c 100%);
  /* news.css sets the same inside news-mode; the welcome needs it too */
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", "Book Antiqua", Georgia, Cambria, "Times New Roman", serif;
}

/* ---------- logo mark + wordmark (newskit.js) ---------- */
.enx-logo { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 23.4%; background: var(--logo-grad); }
.enx-logo svg { width: 100%; height: 100%; }
.enx-wm { font: 800 1em/1 var(--font-display); letter-spacing: -.035em; color: var(--text); white-space: nowrap; }
/* the padding keeps the last letter inside the clipped gradient despite the tight spacing */
.enx-wm > span { padding-right: .05em; margin-right: -.05em; background: var(--logo-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- launch splash (index.html) ---------- */
#splash {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  padding: var(--safe-t) 24px var(--safe-b);
  background: radial-gradient(440px 340px at 50% 45%, rgba(124, 92, 255, .2), transparent 70%), #0a0a10;
  /* fallback: gone by itself after 2.5 s, even if the app never starts */
  animation: sp-gone .4s ease 2.5s forwards;
}
[data-theme="light"] #splash { background: radial-gradient(440px 340px at 50% 45%, rgba(124, 92, 255, .13), transparent 70%), #f4f4f8; }
#splash.out { pointer-events: none; animation: sp-out .32s ease forwards; }
.sp-in { display: grid; justify-items: center; text-align: center; }
.sp-logo { width: 92px; height: 92px; border-radius: 23.4%; box-shadow: 0 26px 56px -20px rgba(109, 91, 255, .85); animation: enx-pop .6s cubic-bezier(.2, .9, .3, 1.2) both; }
.sp-wm { font-size: 38px; margin-top: 22px; animation: enx-rise .5s .1s cubic-bezier(.2, .8, .2, 1) both; }
.sp-tag { margin-top: 10px; font: italic 500 17px/1.3 var(--serif); color: var(--text-2); animation: enx-rise .5s .18s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sp-gone { to { opacity: 0; visibility: hidden; } }
@keyframes sp-out { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }
@keyframes enx-pop { from { opacity: 0; transform: scale(.8); } 60% { opacity: 1; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes enx-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- welcome (views/onboarding.js) ---------- */
body.enx-intro #app { padding-bottom: 0; }
.enx-onb { max-width: 520px; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; padding-top: calc(var(--safe-t) + 14px); }
.enx-step { flex: 1; display: grid; align-content: center; gap: 18px; padding: 6px 0 8px; animation: view-in .32s cubic-bezier(.2, .8, .2, 1) both; }
.enx-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; height: 38px; margin-left: -6px; padding: 0 12px 0 4px; border-radius: 12px; color: var(--text-2); font-weight: 700; font-size: 14px; }
.enx-back svg { width: 22px; height: 22px; }
.enx-back:active { background: var(--surface-2); }
/* the buttons stay in reach while the intro scrolls (not while typing: the keyboard needs the room) */
.enx-foot { position: sticky; bottom: 0; z-index: 5; display: grid; gap: 8px; margin: 0 -16px; padding: 22px 16px calc(var(--safe-b) + 16px); background: linear-gradient(180deg, transparent, var(--bg) 22px); }
body.kb-open .enx-foot { position: static; }
.enx-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.enx-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line-2); transition: width .3s, background .3s; }
.enx-dots i.on { width: 22px; background: var(--brand); }

/* step 1: logo, wordmark, tagline */
.enx-hero { display: grid; justify-items: center; text-align: center; padding-top: 22px; }
.enx-mark { position: relative; isolation: isolate; width: 96px; height: 96px; }
.enx-mark::before { content: ""; position: absolute; inset: -56px; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(124, 92, 255, .42), rgba(224, 82, 156, .16) 60%, transparent); animation: enx-glow 6s ease-in-out infinite alternate; }
[data-theme="light"] .enx-mark::before { background: radial-gradient(closest-side, rgba(124, 92, 255, .24), rgba(224, 82, 156, .1) 60%, transparent); }
.enx-mark .enx-logo { width: 96px; height: 96px; box-shadow: 0 26px 56px -20px rgba(109, 91, 255, .9); animation: enx-pop .7s cubic-bezier(.2, .9, .3, 1.2) both; }
.enx-title { margin-top: 24px; font-size: 42px; animation: enx-rise .5s .12s cubic-bezier(.2, .8, .2, 1) both; }
.enx-tagline { margin-top: 12px; font: italic 600 20px/1.3 var(--serif); animation: enx-rise .5s .2s cubic-bezier(.2, .8, .2, 1) both; }
.enx-lede { max-width: 340px; margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--text-2); animation: enx-rise .5s .26s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes enx-glow { from { opacity: .75; transform: scale(.94); } to { opacity: 1; transform: scale(1.06); } }

/* the demo: a reader paragraph on "paper" (the reading screens' palette) with a tapped word */
.enx-demo {
  --p-bg: #171512; --p-pop: #2c2823; --p-line: rgba(255, 240, 220, .1);
  --p-text: #f4efe6; --p-text-2: #bcb3a4; --p-text-3: #8a8274; --p-brand: #f5a524; --p-soft: rgba(245, 165, 36, .18);
  position: relative; margin-top: 6px; padding: 18px 18px 16px; border-radius: 22px; background: var(--p-bg); border: 1px solid var(--p-line); color: var(--p-text); box-shadow: var(--shadow);
  animation: enx-rise .55s .3s cubic-bezier(.2, .8, .2, 1) both;
}
[data-theme="light"] .enx-demo {
  --p-bg: #fffdf8; --p-pop: #ffffff; --p-line: rgba(70, 45, 10, .12);
  --p-text: #1c1a16; --p-text-2: #5c5549; --p-text-3: #8f8676; --p-brand: #c2410c; --p-soft: rgba(194, 65, 12, .11);
}
.enx-demo-k { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--p-brand); }
.enx-demo-p { margin-top: 8px; font: 400 18px/1.62 var(--serif); }
.enx-dw { margin: 0 -2px; padding: 0 2px; border-radius: 5px; text-decoration: underline dotted var(--p-brand); text-decoration-thickness: 2px; text-underline-offset: 4px; animation: enx-tap .4s .9s ease both; }
@keyframes enx-tap { from { background: transparent; box-shadow: none; } to { background: var(--p-soft); box-shadow: 0 0 0 2px var(--p-soft); } }
/* --ax (set by onboarding.js): where the arrow meets the word */
.enx-pop { --ax: 50%; position: relative; margin-top: 14px; padding: 13px 14px 12px; border-radius: 16px; background: var(--p-pop); border: 1px solid var(--p-line); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .75); transform-origin: var(--ax) 0; animation: enx-pop-in .45s 1.15s cubic-bezier(.2, .9, .3, 1.2) both; }
[data-theme="light"] .enx-pop { box-shadow: 0 16px 34px -16px rgba(70, 45, 10, .32); }
.enx-pop::before { content: ""; position: absolute; top: -7px; left: var(--ax); width: 12px; height: 12px; margin-left: -6px; border-radius: 3px 0 0 0; background: inherit; border-left: 1px solid var(--p-line); border-top: 1px solid var(--p-line); transform: rotate(45deg); }
@keyframes enx-pop-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.enx-pop-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.enx-pop-top .w { font: 800 21px/1.1 var(--serif); }
.enx-pop-top .ipa { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 13px var(--mono); color: var(--p-text-3); }
.enx-pop-top .say { flex: none; align-self: center; width: 30px; height: 30px; margin-left: auto; border-radius: 50%; display: grid; place-items: center; background: var(--p-soft); color: var(--p-brand); }
.enx-pop-top .say svg { width: 16px; height: 16px; }
.enx-pop-def { margin-top: 6px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.enx-pop-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.enx-pop-foot .tr { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; background: var(--p-soft); color: var(--p-brand); font-size: 14px; font-weight: 800; }
.enx-pop-foot .save { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--p-text-2); }
.enx-pop-foot svg { width: 15px; height: 15px; }
.enx-demo-cap { margin: -6px 8px 0; text-align: center; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }

/* what the app does */
.enx-feats { display: grid; gap: 2px; margin-top: 4px; }
.enx-feat { display: flex; align-items: flex-start; gap: 14px; padding: 10px 2px; animation: enx-rise .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.45s + var(--i, 0) * 70ms); }
.enx-feat .ic { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.enx-feat .ic svg { width: 21px; height: 21px; }
.enx-feat .ttl { font-size: 15.5px; font-weight: 750; line-height: 1.3; }
.enx-feat .desc { margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }

/* Gemini key + profile steps */
.enx-head { display: grid; justify-items: start; gap: 8px; }
.enx-head .h1 { margin-top: 10px; }
.enx-head .muted { font-size: 15.5px; line-height: 1.5; }
.enx-badge { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--logo-grad); color: #fff; box-shadow: 0 18px 40px -18px rgba(109, 91, 255, .9); animation: enx-pop .55s cubic-bezier(.2, .9, .3, 1.2) both; }
.enx-badge svg { width: 30px; height: 30px; }

/* ---------- feed (views/news.js): masthead, greeting ---------- */
/* a block in the top bar's title slot, as tall as the back buttons: the bar keeps its height.
   Logo and wordmark lead home (the feed's first screen), here and in the other top bars */
.enx-brand { display: flex; align-items: center; gap: 9px; width: max-content; height: 38px; margin: 0 auto; padding: 0 10px; border-radius: 12px; cursor: pointer; }
.enx-brand .enx-logo { width: 27px; height: 27px; }
.enx-brand .enx-wm { font-size: 23px; }
.enx-brand:active, .enx-home:active { background: var(--surface-2); }
.enx-brand:focus-visible, .enx-home:focus-visible { outline-offset: -2px; } /* the title slot clips anything outside */
/* default title of the other top bars (newskit.js) */
.enx-home { position: relative; display: inline-block; max-width: 100%; padding: 0 8px; border-radius: 8px; vertical-align: top; cursor: pointer; }
.enx-home .enx-wm { font-size: 21px; }
/* a finger-sized target: the bar's height, the source line under the wordmark included (the title
   slot clips by default, so it lets this one out) */
.enx-home::after { content: ""; position: absolute; inset: -8px -10px -22px; }
.nx-brand .t:has(> .enx-home) { overflow: visible; }
.enx-hello { padding: 20px 2px 6px; }
/* the date line carries the study log button at its far right: the greeting below keeps the full width */
.enx-hi-top { display: flex; align-items: center; gap: 12px; }
.enx-date { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
/* small pill with today's study time; the negative margins keep the line as tall as the date */
.enx-study { position: relative; flex: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; margin: -7px 0; padding: 0 11px 0 9px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: 800 12px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; transition: transform .12s, border-color .2s, background .2s; }
.enx-study svg { width: 15px; height: 15px; color: var(--brand); }
.enx-study.on { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.enx-study::after { content: ""; position: absolute; inset: -8px -6px; } /* a finger-sized target */
.enx-study:active { transform: scale(.95); }
@media (hover: hover) { .enx-study:hover { border-color: var(--brand); } }
.enx-greet { margin-top: 6px; font: 800 28px/1.15 var(--serif); letter-spacing: -.015em; text-wrap: balance; }

/* ---------- larger screens ---------- */
@media (min-width: 720px) {
  .enx-onb { padding-top: calc(var(--safe-t) + 32px); }
}
@media (min-width: 1000px) {
  .enx-hello { padding-top: 30px; }
  .enx-greet { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  /* no movement, just a quick fade (the global rule in app.css would cut it to nothing) */
  #splash.out { animation: sp-out .2s ease forwards !important; }
  /* everything shows at once instead of one after the other */
  .enx-step, .enx-step * { animation-delay: 0s !important; }
}
