/* Bizvio — Malayalam tech news, built like a mobile app.
   Palette: powder blue, pure white, vibrant racing orange. Fonts: Baloo Chettan 2 (headings), Noto Sans Malayalam (text). */

:root {
  --powder: #B0E0E6;
  --powder-soft: #E6F5F8;
  --powder-mid: #CDEBEF;
  --powder-deep: #7CC3CE;
  --powder-ink: #1F5F69;
  --white: #FFFFFF;
  --orange: #FF5F00;
  --orange-press: #E55400;
  --orange-ink: #C44900;   /* orange for text on white (AA) */
  --orange-soft: #FFE7D9;
  --ink: #0B1F33;
  --ink-2: #3A4E62;
  --muted: #5E7286;
  --line: #D5E9EC;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 31, 51, .06), 0 4px 14px rgba(11, 31, 51, .06);
  --appbar-h: 58px;
  --tabbar-h: 66px;
  --col: 680px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --head: 'Baloo Chettan 2', 'Noto Sans Malayalam', system-ui, sans-serif;
  --text: 'Noto Sans Malayalam', 'Baloo Chettan 2', system-ui, sans-serif;
  color-scheme: light;
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--appbar-h) + 12px); }
body {
  margin: 0;
  background: var(--powder-soft);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 800; line-height: 1.3; margin: 0; letter-spacing: -.005em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: 600; font-style: normal; font-size: 24px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap;
  direction: ltr; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  width: 1em; overflow: hidden; user-select: none;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24; }

.wrap { max-width: var(--col); margin: 0 auto; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--white);
  padding-top: var(--safe-t);
  box-shadow: 0 1px 0 var(--line);
  transition: transform .25s ease;
}
.appbar.hide { transform: translateY(-100%); }
.appbar-row {
  max-width: var(--col); margin: 0 auto;
  height: var(--appbar-h);
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px 0 16px;
}
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 800; font-size: 26px; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 11px; background: var(--orange); color: var(--white);
  display: grid; place-items: center; font-size: 22px; transform: skewX(-8deg);
  box-shadow: 3px 3px 0 var(--powder);
}
.logo-mark span { transform: skewX(8deg); margin-top: 2px; }
.logo .dot { color: var(--orange); }
.logo-name { display: inline-flex; align-items: baseline; }
.appbar-title { font-family: var(--head); font-weight: 800; font-size: 20px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink);
  transition: background .15s;
}
.icon-btn:active, .icon-btn:hover { background: var(--powder-soft); }
.icon-btn.on { color: var(--orange); }
.icon-btn.on .ms { font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24; }

/* ---------- Section chips ---------- */
.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 16px 12px; max-width: var(--col); margin: 0 auto;
  scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 999px;
  background: var(--powder-soft); color: var(--powder-ink);
  font-family: var(--head); font-weight: 800; font-size: 16px; white-space: nowrap;
  border: 2px solid var(--powder-mid);
  transition: background .15s, color .15s, transform .1s;
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--orange); border-color: var(--orange); color: var(--white); box-shadow: 0 3px 0 var(--orange-press); }
.chip .ms { font-size: 18px; }

/* ---------- Breaking ticker ---------- */
.ticker {
  display: flex; align-items: stretch; overflow: hidden;
  margin: 12px 16px 0; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--white);
}
.ticker-label {
  flex: none; display: flex; align-items: center; gap: 4px; padding: 0 12px;
  background: var(--orange); color: var(--ink);
  font-family: var(--head); font-weight: 800; font-size: 14px; letter-spacing: .04em; text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); padding-right: 20px;
}
.ticker-label .ms { font-size: 18px; }
.ticker-track { overflow: hidden; flex: 1; position: relative; mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent); }
.ticker-move { display: inline-flex; gap: 40px; white-space: nowrap; padding: 10px 0 9px 12px; animation: ticker var(--ticker-s, 30s) linear infinite; font-weight: 700; font-size: 15px; }
.ticker-move a::before { content: '●'; color: var(--orange); margin-right: 10px; font-size: 10px; vertical-align: 2px; }
.ticker:hover .ticker-move { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Section headings ---------- */
.sec-head { display: flex; align-items: center; gap: 10px; padding: 22px 16px 10px; }
.sec-head h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
.sec-head h2::before { content: ''; width: 6px; height: 22px; border-radius: 3px; background: var(--orange); transform: skewX(-12deg); }
.sec-head .more-link { margin-left: auto; display: inline-flex; align-items: center; color: var(--orange-ink); font-family: var(--head); font-weight: 800; font-size: 15px; }
.sec-head .more-link .ms { font-size: 20px; }

/* ---------- Hero carousel ---------- */
.hero { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 14px 16px 4px; scrollbar-width: none; }
.hero::-webkit-scrollbar { display: none; }
.hero-card {
  position: relative; flex: none; width: 88%; aspect-ratio: 4 / 3.4; scroll-snap-align: center;
  border-radius: var(--radius); overflow: hidden; background: var(--powder); box-shadow: var(--shadow);
}
.hero-card:only-child { width: 100%; }
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-card .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,31,51,0) 35%, rgba(11,31,51,.88) 100%); }
.hero-card .body { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; color: var(--white); }
.hero-card h3 { font-size: 22px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.hero-card .meta { color: rgba(255,255,255,.85); margin-top: 6px; }
.dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; }
.dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--powder-deep); transition: width .2s, background .2s; }
.dots i.on { width: 22px; background: var(--orange); }

/* ---------- Badges & meta ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--head); font-weight: 800; font-size: 13px; line-height: 1;
  padding: 5px 9px 4px; border-radius: 7px;
  background: var(--powder); color: var(--ink);
}
.badge.orange { background: var(--orange); color: var(--ink); }
.badge.ghost { background: transparent; color: var(--orange-ink); padding: 0; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.meta .ms { font-size: 16px; vertical-align: -3px; }

/* ---------- Cards ---------- */
.list { display: grid; gap: 10px; padding: 0 16px; }
.card {
  position: relative; display: flex; gap: 12px; align-items: stretch;
  background: var(--white); border-radius: var(--radius); padding: 12px;
  box-shadow: var(--shadow); border: 2px solid transparent;
  transition: transform .12s, border-color .15s;
}
.card:active { transform: scale(.985); }
.card:hover { border-color: var(--powder); }
.card .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.card h3 { font-size: 17px; line-height: 1.38; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .thumb { flex: none; width: 108px; height: 108px; border-radius: var(--radius-sm); overflow: hidden; background: var(--powder-mid); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .meta { margin-top: auto; padding-right: 40px; }
.card.lead .meta { padding-right: 44px; }
.card .save { position: absolute; right: 4px; bottom: 2px; width: 38px; height: 38px; }
.card.has-thumb .save { right: 128px; }
.card .stretch::after, .mini .stretch::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.card .save { z-index: 2; }

.card.lead { flex-direction: column; padding: 0; overflow: hidden; }
.card.lead .thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 0; }
.card.lead .txt { padding: 4px 14px 14px; }
.card.lead h3 { font-size: 21px; -webkit-line-clamp: 4; }
.card.lead .save { right: 6px; bottom: 6px; }
.card .summary { color: var(--ink-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.rail { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.mini {
  flex: none; width: 210px; scroll-snap-align: start; position: relative;
  background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.mini .thumb { aspect-ratio: 16 / 10; background: var(--powder-mid); }
.mini .thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini .txt { padding: 10px 12px 12px; }
.mini h3 { font-size: 16px; line-height: 1.38; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mini .meta { margin-top: 6px; }

.ph { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(135deg, var(--powder) 0%, var(--powder-soft) 100%); color: var(--powder-ink); }
.ph .ms { font-size: 36px; opacity: .7; }

/* Infinite scroll */
.more { padding: 16px; text-align: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px;
  background: var(--orange); color: var(--white);
  font-family: var(--head); font-weight: 800; font-size: 19px; line-height: 1;
  box-shadow: 0 4px 0 var(--orange-press);
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-press); }
.btn.soft { background: var(--white); color: var(--ink); box-shadow: 0 3px 0 var(--powder-deep); border: 2px solid var(--powder); }
.skeleton { display: grid; gap: 10px; padding: 0 16px; }
.skeleton div { height: 132px; border-radius: var(--radius); background: linear-gradient(90deg, var(--white) 0%, var(--powder-soft) 50%, var(--white) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.end-note { text-align: center; color: var(--muted); font-size: 14px; padding: 20px 16px 8px; }

/* ---------- Page header (lists) ---------- */
.page-head { padding: 18px 16px 6px; display: flex; align-items: center; gap: 12px; }
.page-head .icon { width: 48px; height: 48px; border-radius: 14px; background: var(--orange); color: var(--white); display: grid; place-items: center; box-shadow: 3px 3px 0 var(--powder); }
.page-head h1 { font-size: 28px; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }

.search-box { padding: 14px 16px 6px; }
.search-box form { display: flex; align-items: center; gap: 8px; background: var(--white); border: 2px solid var(--powder); border-radius: 16px; padding: 0 6px 0 14px; box-shadow: var(--shadow); }
.search-box form:focus-within { border-color: var(--orange); }
.search-box input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink); }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .ms { font-size: 56px; color: var(--powder-deep); }
.empty h2 { color: var(--ink); font-size: 22px; margin: 10px 0 4px; }

/* ---------- Sections grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 16px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 120px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); border: 2px solid transparent;
}
.tile:hover { border-color: var(--powder); }
.tile .ms { font-size: 30px; color: var(--orange); }
.tile h3 { font-size: 19px; }
.tile small { color: var(--muted); font-weight: 600; margin-top: auto; }
.menu-list { margin: 16px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 16px; font-weight: 700; text-align: left; border-bottom: 1px solid var(--line); }
.menu-list > :last-child { border-bottom: 0; }
.menu-list .ms { color: var(--powder-ink); }
.menu-list .go { margin-left: auto; color: var(--muted); }

/* ---------- Article ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 50; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.article { background: var(--white); max-width: var(--col); margin: 0 auto; padding-bottom: 8px; }
.article .cover { aspect-ratio: 16 / 9; background: var(--powder-mid); overflow: hidden; }
.article .cover img { width: 100%; height: 100%; object-fit: cover; }
.article figcaption { font-size: 13px; color: var(--muted); padding: 6px 16px 0; }
.article header { padding: 16px 16px 4px; }
.article h1 { font-size: 28px; line-height: 1.32; margin: 10px 0 8px; }
.article .sub { font-size: 18px; color: var(--ink-2); font-weight: 600; line-height: 1.55; margin: 0 0 10px; }
.byline { display: flex; align-items: center; gap: 10px; padding: 12px 0 14px; border-bottom: 2px solid var(--powder-soft); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--powder); display: grid; place-items: center; font-family: var(--head); font-weight: 800; color: var(--powder-ink); }
.byline strong { display: block; font-family: var(--head); font-weight: 800; font-size: 16px; line-height: 1.2; }
.prose { padding: 6px 16px 8px; font-size: 18px; line-height: 1.85; font-weight: 500; color: #12263A; overflow-wrap: anywhere; }
.prose > * { margin: 0 0 1em; }
.prose h2 { font-size: 23px; margin: 1.4em 0 .5em; }
.prose h3 { font-size: 20px; margin: 1.3em 0 .4em; }
.prose h4 { font-size: 18px; margin: 1.2em 0 .4em; }
.prose a { color: var(--orange-ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: rgba(255,95,0,.35); }
.prose img { border-radius: var(--radius-sm); height: auto; margin: 0 auto; }
.prose figure { margin: 1.2em 0; }
.prose figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 6px; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose blockquote > :first-child { margin-top: 0; }
.prose blockquote { margin: 1.2em 0; padding: 12px 16px; border-left: 5px solid var(--orange); background: var(--powder-soft); border-radius: 0 12px 12px 0; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--orange); font-weight: 800; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--powder-soft); font-family: var(--head); font-weight: 800; }
.prose pre { background: var(--ink); color: #E8F6F8; padding: 14px; border-radius: 12px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.prose code { font-size: .88em; background: var(--powder-soft); padding: 1px 5px; border-radius: 5px; }
.prose pre code { background: none; padding: 0; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radius-sm); }
.prose hr { border: 0; height: 3px; background: var(--powder); border-radius: 2px; }
.prose strong { font-weight: 700; color: var(--ink); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 14px; }
.tags a { padding: 6px 12px; border-radius: 999px; background: var(--powder-soft); color: var(--powder-ink); font-weight: 700; font-size: 14px; border: 2px solid var(--powder-mid); }
.source { margin: 0 16px 16px; padding: 12px 14px; border-radius: 12px; background: var(--powder-soft); font-size: 14px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.source a { color: var(--orange-ink); font-weight: 700; }
.share-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 4px 16px 18px; }
.share-bar a, .share-bar button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px;
  background: var(--powder-soft); font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.share-bar .ico { width: 26px; height: 26px; display: grid; place-items: center; }
.share-bar svg { width: 24px; height: 24px; }
.share-bar .wa { background: #E3F8EA; color: #0B6B33; }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar ul { list-style: none; margin: 0 auto; padding: 0 4px; max-width: var(--col); display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h); }
.tabbar a { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-family: var(--head); font-weight: 700; font-size: 12.5px; color: var(--muted); }
.tabbar .pill { width: 58px; height: 32px; border-radius: 16px; display: grid; place-items: center; transition: background .2s; }
.tabbar a.on { color: var(--ink); font-weight: 800; }
.tabbar a.on .pill { background: var(--orange); color: var(--white); box-shadow: 0 3px 0 var(--orange-press); }
.tabbar a.on .ms { font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24; }
.tabbar .count { position: absolute; margin: -18px 0 0 26px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: var(--white); font-size: 11px; line-height: 18px; text-align: center; font-family: var(--text); }
.tabbar .count:empty { display: none; }

/* ---------- Toast, install, footer ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--white); padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 15px;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(11,31,51,.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.install {
  display: none; margin: 16px; padding: 14px; border-radius: var(--radius); background: var(--ink); color: var(--white);
  align-items: center; gap: 12px;
}
.install.show { display: flex; }
.install .logo-mark { flex: none; box-shadow: none; }
.install p { margin: 0; flex: 1; font-size: 14px; line-height: 1.4; }
.install p strong { font-family: var(--head); font-size: 17px; display: block; }
.install .btn { min-height: 40px; font-size: 16px; padding: 0 14px; }
.site-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 16px 18px; }
.site-foot a { color: var(--orange-ink); font-weight: 700; }

/* ---------- Larger screens: keep the app column, a bit roomier ---------- */
@media (min-width: 720px) {
  .hero-card { width: 72%; }
  .article { margin-top: 12px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
  .article h1 { font-size: 34px; }
  .card .thumb { width: 140px; height: 112px; }
  .card.has-thumb .save { right: 160px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
