/* =========================================================
   CURRENTS@CMFRI — Home page styles
   ========================================================= */
:root {
  --navy: #0a2238;
  --navy-2: #0f3150;
  --ocean: #0d4f73;
  --teal: #0e8a8c;
  --cmfri-blue: #129fd4;
  --icar-green: #08963a;
  --sand: #f3ece0;
  --paper: #faf8f3;
  --surface: #ffffff;
  --ink: #142433;
  --muted: #5a6b79;
  --line: #e2e7ec;
  --accent: #f2a541;
  --accent-ink: #3a2400;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(10, 34, 56, .06), 0 2px 8px rgba(10, 34, 56, .05);
  --shadow: 0 10px 30px rgba(10, 34, 56, .10);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: var(--fs); }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }

.ic {
  width: 1.1em; height: 1.1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.18em;
}
.ic.big { width: 30px; height: 30px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--cmfri-blue); outline-offset: 2px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; white-space: nowrap;
  transition: transform .15s, background .2s, box-shadow .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ocean); color: #fff; }
.btn-primary:hover { background: var(--navy-2); box-shadow: var(--shadow-sm); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #f7b65d; }
.btn-outline { border-color: var(--ocean); color: var(--ocean); background: transparent; }
.btn-outline:hover { background: var(--ocean); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

/* ---------- Top utility bar ---------- */
.topbar { background: var(--navy); color: #c6d4e1; font-size: .8rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 38px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar a:hover { color: #fff; }
.topbar .sep { opacity: .4; }
.font-ctrl { display: flex; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; overflow: hidden; }
.font-ctrl button { background: none; border: 0; color: #c6d4e1; padding: 2px 8px; font-size: .75rem; }
.font-ctrl button + button { border-left: 1px solid rgba(255,255,255,.2); }
.font-ctrl button:hover { background: rgba(255,255,255,.1); color: #fff; }
.lang { display: inline-flex; align-items: center; gap: 6px; }
.lang select { background: transparent; color: #c6d4e1; border: 0; font: inherit; cursor: pointer; }
.lang select option { color: var(--ink); }
.curator-link { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 6px; background: rgba(255,255,255,.08); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 60px; height: 60px; border-radius: 10px; background: #fff;
  display: grid; place-items: center; padding: 2px; flex: none;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo.sm { width: 56px; height: 56px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--serif); font-weight: 700; font-size: 1.6rem; letter-spacing: .01em;
  color: var(--navy);
}
.brand-name .at { color: var(--cmfri-blue); }
.brand-cap { font-size: .8rem; color: var(--muted); letter-spacing: .02em; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .93rem; color: #33475a;
  transition: background .2s, color .2s;
}
.main-nav a:hover { background: #eef4f8; color: var(--ocean); }
.main-nav a.active { color: var(--ocean); font-weight: 600; box-shadow: inset 0 -2px 0 var(--cmfri-blue); border-radius: 0; }
.main-nav .nav-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 8px;
  background: linear-gradient(135deg, var(--ocean), var(--teal)); color: #fff;
  border-radius: 999px; padding: 9px 16px;
}
.main-nav .nav-cta:hover { color: #fff; background: linear-gradient(135deg, var(--navy-2), var(--ocean)); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px; color: var(--navy); }
.nav-toggle .ic { width: 22px; height: 22px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(18,159,212,.45), transparent 60%),
    radial-gradient(800px 400px at 0% 100%, rgba(14,138,140,.45), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--ocean) 70%, #11688f 100%);
  padding: 64px 0 120px;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0; opacity: .08;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 22px 22px;
}
.waves { position: absolute; bottom: -1px; left: 0; width: 100%; height: 140px; }
.hero-inner { position: relative; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  padding: 6px 14px; border-radius: 999px; font-size: .82rem; color: #d9ecf6;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #5ee2a0; box-shadow: 0 0 0 4px rgba(94,226,160,.2); }
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3.4rem); margin: 20px auto 14px; max-width: 900px;
}
.hero h1 em { font-style: italic; color: #9fe0f7; }
.lead { max-width: 760px; margin: 0 auto; color: #d2e3ee; font-size: 1.07rem; }

/* Search panel */
.search-panel {
  max-width: 940px; margin: 34px auto 0; text-align: left;
  background: var(--surface); color: var(--ink);
  border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.25);
  padding: 14px 16px 14px;
}
.search-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 10px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.search-tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 0; background: none; color: var(--muted); padding: 7px 12px; border-radius: 8px; font-size: .87rem; font-weight: 500;
}
.tab:hover { background: #f1f5f8; color: var(--ink); }
.tab.active { background: #e5f3fa; color: var(--ocean); font-weight: 600; }
.search-row { display: flex; align-items: center; gap: 10px; padding: 14px 4px 10px; }
.search-ic { width: 22px; height: 22px; color: var(--muted); }
.search-row input {
  flex: 1; min-width: 0; border: 0; outline: none; font-size: 1.06rem; color: var(--ink); background: transparent;
}
.search-row input::placeholder { color: #95a3af; }
.mode-pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 600;
  color: var(--teal); background: #e3f5f2; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.search-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 4px 2px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--ocean); font-weight: 600; font-size: .87rem; padding: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-label { font-size: .8rem; color: var(--muted); }
.chip {
  border: 1px solid var(--line); background: #f8fafb; color: #34495c;
  padding: 4px 11px; border-radius: 999px; font-size: .8rem;
  transition: all .2s;
}
.chip:hover { border-color: var(--cmfri-blue); color: var(--ocean); background: #eef8fd; }
.adv-panel {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  border-top: 1px solid var(--line); margin-top: 10px; padding: 14px 4px 4px;
}
.adv-panel[hidden] { display: none; }
.adv-panel label { display: flex; flex-direction: column; gap: 4px; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.adv-panel input, .adv-panel select {
  font: inherit; font-size: .9rem; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff;
}

/* Stats */
.stats {
  list-style: none; margin: 40px auto 0; padding: 0; max-width: 940px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
.stats li { display: flex; flex-direction: column; align-items: center; }
.stats strong { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; }
.stats span { font-size: .8rem; color: #b9d3e3; }

/* ---------- Quick access ---------- */
.quick {
  position: relative; z-index: 2; margin-top: -54px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.quick-card {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.quick-card:hover { transform: translateY(-3px); border-color: #bfe3f3; }
.quick-card strong { display: block; color: var(--navy); font-size: .98rem; }
.quick-card small { color: var(--muted); font-size: .8rem; line-height: 1.4; display: block; }
.q-ic {
  width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: #e8f4fa; color: var(--ocean);
}
.q-ic .ic { width: 22px; height: 22px; }
.q-ask { background: linear-gradient(135deg, #0d4f73, #0e8a8c); border-color: transparent; }
.q-ask strong, .q-ask small { color: #fff; }
.q-ask small { opacity: .85; }
.q-ask .q-ic { background: rgba(255,255,255,.16); color: #fff; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 34px; flex-wrap: wrap; }
.section-head.center { justify-content: center; text-align: center; }
.section-head.center .sub { margin-left: auto; margin-right: auto; }
.kicker { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 8px; }
.kicker.light { color: #7fd6e8; }
.section h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--navy); }
.sub { color: var(--muted); max-width: 640px; margin-top: 10px; }

/* ---------- Digital Wall ---------- */
.wall-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line); background: var(--surface); color: #3a4d5e;
  padding: 7px 16px; border-radius: 999px; font-size: .87rem; font-weight: 500;
}
.pill:hover { border-color: var(--ocean); }
.pill.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.wall-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, opacity .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card.hide { display: none; }
.card.feature { grid-column: span 2; grid-row: span 2; }
.card.feature .media { aspect-ratio: auto; flex: 1; min-height: 300px; }
.card.feature h3 { font-size: 1.45rem; }
.media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.media > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ocean-1 { background: linear-gradient(180deg, #f6b26b 0%, #e98b6d 25%, #3c7ea8 55%, #0d4f73 100%); }
.ocean-2 { background: linear-gradient(135deg, #0a2238, #155f86 60%, #1b8fb5); }
.ocean-3 { background: linear-gradient(135deg, #3a6f8f, #0e8a8c); }
.badge {
  position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.94); color: var(--navy); box-shadow: var(--shadow-sm);
}
.b-news .ic { color: #b5651d; }
.b-photo .ic { color: var(--teal); }
.b-video .ic { color: #c0392b; }
.b-audio .ic { color: #7d4cc4; }

/* Newspaper clipping mock */
.m-clip { background: #e9e2d2; display: grid; place-items: center; padding: 18px; }
.clip {
  width: 86%; height: 100%; background: #f7f1e3; padding: 12px 14px; transform: rotate(-1.5deg);
  box-shadow: 0 6px 16px rgba(60,40,10,.18); display: flex; flex-direction: column; gap: 6px;
  font-family: Georgia, serif; color: #2b2418; margin-top: 18px;
}
.clip-mast { font-size: .58rem; letter-spacing: .14em; border-bottom: 1px solid #2b2418; padding-bottom: 3px; text-transform: uppercase; }
.clip-head { font-weight: 700; font-size: .95rem; line-height: 1.15; }
.clip-ml .clip-head { font-family: "Noto Sans Malayalam", "Nirmala UI", sans-serif; font-size: .85rem; }
.clip-lines {
  flex: 1; min-height: 30px;
  background:
    repeating-linear-gradient(180deg, rgba(43,36,24,.28) 0 2px, transparent 2px 7px) left/47% 100% no-repeat,
    repeating-linear-gradient(180deg, rgba(43,36,24,.28) 0 2px, transparent 2px 7px) right/47% 100% no-repeat;
}

/* Video */
.m-video { display: grid; place-items: center; }
.play {
  width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--navy);
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.3); transition: transform .2s;
}
.play .ic { width: 22px; height: 22px; margin-left: 3px; stroke: none; }
.card:hover .play { transform: scale(1.08); }
.duration { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: .72rem; padding: 2px 7px; border-radius: 4px; }

/* Audio */
.m-audio { background: linear-gradient(135deg, #2b1f4e, #4f3a8a); display: grid; place-items: center; }
.wave-bars { display: flex; align-items: center; gap: 4px; height: 60%; }
.wave-bars i { display: block; width: 5px; border-radius: 3px; background: rgba(255,255,255,.75); animation: wave 1.4s ease-in-out infinite; }
.wave-bars i:nth-child(odd) { animation-delay: -.4s; }
.wave-bars i:nth-child(3n) { animation-delay: -.8s; }
.wave-bars i:nth-child(4n) { animation-delay: -1.1s; }
@keyframes wave { 0%,100% { height: 18%; } 50% { height: 90%; } }

.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--muted); align-items: center; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.theme { background: #eef6ee; color: #1f6b33; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.card h3 { font-size: 1.04rem; color: var(--navy); font-weight: 650; }
.card p { color: var(--muted); font-size: .92rem; }
.linked { display: flex; align-items: center; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.linked > span { display: inline-flex; align-items: center; gap: 4px; }
.more { margin-left: auto; color: var(--ocean); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.more:hover { text-decoration: underline; }
.ai-tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600;
  color: #6b3fb5; background: #f1eafb; padding: 3px 9px; border-radius: 999px;
}
.ai-tag.light { color: #fff; background: rgba(255,255,255,.18); }

/* Carousel */
.carousel-wrap { margin-top: 48px; background: var(--sand); border-radius: 18px; padding: 24px; }
.carousel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.carousel-head h3 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: #4a3517; display: flex; gap: 8px; align-items: center; }
.carousel-ctrl { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid #d8cbb3; background: #fff;
  display: grid; place-items: center; color: #4a3517;
}
.icon-btn:hover { background: #4a3517; color: #fff; }
.carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 16px) / 5); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 6px; scrollbar-width: thin;
}
.c-item { scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; }
.c-thumb {
  aspect-ratio: 4 / 3; border-radius: 10px; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: 10px; filter: sepia(.6);
  transition: filter .3s;
}
.c-item:hover .c-thumb { filter: sepia(0); }
.c-thumb::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.04) 0 1px, transparent 1px 3px); }
.c-thumb span { position: relative; z-index: 1; font-family: var(--serif); font-weight: 700; color: #fff; font-size: 1.3rem; text-shadow: 0 2px 6px rgba(0,0,0,.4); }
.sepia { background: linear-gradient(160deg, #a58b66, #5d4a33); }
.sepia-2 { background: linear-gradient(160deg, #7c8a8f, #3d4a52); }
.sepia-3 { background: linear-gradient(160deg, #8f7a5c, #45524f); }
.c-item p { font-size: .88rem; font-weight: 600; color: #3a2a12; line-height: 1.35; }
.c-item small { font-size: .75rem; color: #7a6a52; }

/* ---------- Ask the Archive ---------- */
.ask {
  background:
    radial-gradient(700px 400px at 100% 0%, rgba(18,159,212,.25), transparent 60%),
    linear-gradient(160deg, var(--navy), #0c3a57);
  color: #e3eef5;
}
.ask-inner { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; }
.ask h2 { color: #fff; }
.ask-intro > p { margin-top: 14px; color: #c3d6e4; }
.ask-intro strong { color: #fff; }
.rag-steps { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.rag-steps li { display: flex; align-items: center; gap: 12px; font-size: .93rem; color: #d7e6ef; }
.rag-steps li span {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(127,214,232,.15); color: #7fd6e8; font-weight: 700; font-size: .8rem; border: 1px solid rgba(127,214,232,.35);
}
.safeguard { display: flex; gap: 8px; align-items: flex-start; margin-top: 22px !important; font-size: .87rem; background: rgba(255,255,255,.06); padding: 12px 14px; border-radius: 10px; border-left: 3px solid var(--accent); }
.safeguard .ic { color: var(--accent); margin-top: 3px; }

.chat {
  background: #fff; color: var(--ink); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,.35); display: flex; flex-direction: column;
}
.chat-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.chat-title { font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.ai-dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--cmfri-blue), var(--teal)); box-shadow: 0 0 0 4px rgba(18,159,212,.15); }
.chat-note { font-size: .72rem; color: #8a5a00; background: #fff4e0; padding: 3px 9px; border-radius: 999px; }
.chat-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; max-height: 430px; overflow-y: auto; background: #f7f9fb; }
.msg { max-width: 92%; font-size: .92rem; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--ocean); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); padding: 14px; border-radius: 14px 14px 14px 4px; }
.cite { color: var(--ocean); font-weight: 700; margin-left: 1px; cursor: pointer; }
.sources { display: grid; gap: 8px; margin-top: 12px; }
.src { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; transition: border-color .2s, background .2s; }
.src:hover { border-color: var(--cmfri-blue); background: #f3fafd; }
.src b { display: block; font-size: .83rem; color: var(--navy); font-weight: 600; }
.src small { font-size: .74rem; color: var(--muted); }
.src-th { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.th-news { background: #f6ecdc; color: #b5651d; }
.th-photo { background: #e1f3f1; color: var(--teal); }
.th-video { background: #fbe6e3; color: #c0392b; }
.fb { display: flex; gap: 6px; align-items: center; margin-top: 10px; font-size: .75rem; color: var(--muted); }
.fb button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 1px 7px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aaebd; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 18px 0; background: #fff; }
.chip-dark { background: #eef4f8; }
.chat-input { display: flex; gap: 8px; padding: 12px 18px 16px; background: #fff; }
.chat-input input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; font: inherit; font-size: .93rem; }
.chat-input input:focus { outline: none; border-color: var(--cmfri-blue); box-shadow: 0 0 0 3px rgba(18,159,212,.15); }
.chat-input .btn { padding: 0 16px; }

/* ---------- Exhibitions ---------- */
.ex-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 22px; }
.ex-card {
  position: relative; border-radius: 18px; overflow: hidden; color: #fff; min-height: 380px;
  display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow);
  transition: transform .3s;
}
.ex-card:hover { transform: translateY(-5px); }
.ex-art { position: absolute; inset: 0; }
.ex-art svg { width: 100%; height: 100%; transition: transform .6s; }
.ex-card:hover .ex-art svg { transform: scale(1.06); }
.ex-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(5,20,35,.85)); }
.ex-seaweed { background: linear-gradient(160deg, #2f8f5b, #0b5b4b 60%, #083a3a); }
.ex-vessel { background: linear-gradient(160deg, #1b6fa0, #0a2f52); }
.ex-cage { background: linear-gradient(160deg, #1aa5b5, #0b4f6e); }
.ex-body { position: relative; z-index: 1; padding: 24px; }
.ex-tag { display: inline-block; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; }
.ex-body h3 { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; }
.ex-seaweed .ex-body h3 { font-size: 1.85rem; }
.ex-body p { color: #d5e4ee; font-size: .92rem; margin-top: 8px; }
.ex-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; font-size: .78rem; color: #c9dbe7; align-items: center; }
.ex-meta > span:not(.ai-tag) { border: 1px solid rgba(255,255,255,.3); padding: 2px 9px; border-radius: 999px; }

/* ---------- Timeline ---------- */
.timeline-sec { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.decades { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.decade {
  border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 14px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: all .2s;
}
.decade b { font-family: var(--serif); font-size: 1.2rem; color: var(--navy); }
.decade span { font-size: .72rem; color: var(--muted); text-align: center; line-height: 1.3; }
.decade:hover { border-color: var(--cmfri-blue); }
.decade.active { background: var(--navy); border-color: var(--navy); }
.decade.active b { color: #fff; }
.decade.active span { color: #a9c6da; }
.decade-bar { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; height: 70px; align-items: end; margin-top: 14px; }
.decade-bar .bar { height: var(--h); background: linear-gradient(180deg, #bfe3f3, #e7f4fa); border-radius: 6px 6px 0 0; transition: background .3s; }
.decade-bar .bar.active { background: linear-gradient(180deg, var(--cmfri-blue), var(--ocean)); }
.decade-caption { text-align: center; margin-top: 18px; color: var(--muted); }
.decade-caption strong { color: var(--navy); }

/* ---------- Browse ---------- */
.browse-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.browse-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 6px; transition: all .2s;
}
.browse-card:hover { border-color: #bfe3f3; box-shadow: var(--shadow); transform: translateY(-3px); }
.browse-card strong { color: var(--navy); font-size: 1rem; margin-top: 8px; }
.browse-card small { color: var(--muted); font-size: .84rem; line-height: 1.45; }
.b-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.b-ic .ic { width: 22px; height: 22px; }
.c1 { background: #e6f5ea; color: var(--icar-green); }
.c2 { background: #e5f3fa; color: var(--cmfri-blue); }
.c3 { background: #f0eafb; color: #6b3fb5; }
.c4 { background: #fdf0e1; color: #c17418; }
.c5 { background: #fde8e8; color: #c0392b; }
.c6 { background: #e3eef7; color: var(--ocean); }
.c7 { background: #e1f3f1; color: var(--teal); }
.c8 { background: #eef0f3; color: #44576a; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; align-items: center; }
.tc-label { font-weight: 600; font-size: .85rem; color: var(--muted); margin-right: 4px; }
.tag-cloud a { font-size: .84rem; padding: 6px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: #34495c; }
.tag-cloud a:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- AI section ---------- */
.ai-sec { background: linear-gradient(180deg, var(--paper), #eef5f8); }
.ai-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.ai-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: var(--shadow-sm); overflow: hidden;
}
.ai-card .ic.big { color: var(--teal); }
.ai-num { position: absolute; right: 14px; top: 8px; font-family: var(--serif); font-size: 2.6rem; font-weight: 700; color: #edf2f5; }
.ai-card h3 { font-size: 1rem; color: var(--navy); margin: 14px 0 8px; }
.ai-card p { font-size: .86rem; color: var(--muted); line-height: 1.55; }
.open-strip {
  margin-top: 34px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  background: var(--navy); color: #c9d9e5; border-radius: 16px; padding: 22px 24px;
}
.open-strip > div { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; line-height: 1.45; }
.open-strip b { color: #fff; }
.open-strip .ic { color: #7fd6e8; width: 20px; height: 20px; margin-top: 1px; }

/* ---------- Contribute ---------- */
.contribute { padding-bottom: 84px; }
.contrib-card {
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--icar-green), #0b7a4a 45%, var(--teal));
  color: #fff; border-radius: 20px; padding: 40px 44px; box-shadow: var(--shadow);
}
.contrib-card h2 { font-family: var(--serif); font-weight: 600; font-size: 1.8rem; }
.contrib-card p { margin-top: 10px; max-width: 680px; color: #e1f3ea; }
.contrib-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: #071a2b; color: #a9bccb; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 40px; padding-top: 60px; padding-bottom: 44px; }
.f-logo-row { display: flex; gap: 14px; align-items: center; }
.f-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: #fff; line-height: 1.25; }
.f-sub { font-size: .82rem; color: #8fb3c9; margin-top: 2px; }
.f-desc { margin-top: 18px; line-height: 1.65; max-width: 420px; }
.site-footer h4 { color: #fff; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.contact li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.contact .ic { color: #7fd6e8; margin-top: 3px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); background: #05131f; }
.fb-inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; font-size: .82rem; }
.fb-inner strong { color: #fff; }

.to-top {
  position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--ocean); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 40;
}
.to-top .ic { transform: rotate(-90deg); }
.to-top.show { opacity: 1; pointer-events: auto; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .main-nav a { padding: 8px 9px; font-size: .88rem; }
}
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 16px 16px; gap: 2px;
    box-shadow: var(--shadow); display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a.active { box-shadow: inset 3px 0 0 var(--cmfri-blue); }
  .main-nav .nav-cta { margin: 8px 0 0; justify-content: center; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .ai-grid { grid-template-columns: repeat(3, 1fr); }
  .open-strip { grid-template-columns: repeat(2, 1fr); }
  .ask-inner { grid-template-columns: 1fr; gap: 36px; }
  .carousel { grid-auto-columns: calc((100% - 2 * 16px) / 3); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .adv-panel { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .wall-grid { grid-template-columns: repeat(2, 1fr); }
  .card.feature { grid-column: span 2; grid-row: auto; }
  .ex-grid { grid-template-columns: 1fr; }
  .ex-card { min-height: 300px; }
  .browse-grid { grid-template-columns: repeat(2, 1fr); }
  .decades { grid-template-columns: repeat(3, 1fr); }
  .decade-bar { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); row-gap: 20px; }
  .topbar-left span:first-child, .topbar-left .sep { display: none; }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .topbar-inner { flex-wrap: wrap; justify-content: center; padding: 6px 0; gap: 8px; }
  .topbar-left { display: none; }
  .header-inner { min-height: 68px; }
  .brand-logo { width: 48px; height: 48px; }
  .brand-name { font-size: 1.25rem; }
  .brand-cap { font-size: .7rem; }
  .hero { padding: 44px 0 100px; }
  .mode-pill { display: none; }
  .search-row { flex-wrap: wrap; }
  .search-row input { flex-basis: calc(100% - 40px); }
  .search-row .btn { width: 100%; }
  .adv-panel { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats strong { font-size: 1.5rem; }
  .quick { grid-template-columns: 1fr; margin-top: -44px; }
  .section { padding: 60px 0; }
  .wall-grid { grid-template-columns: 1fr; }
  .card.feature { grid-column: auto; }
  .card.feature .media { min-height: 220px; }
  .carousel { grid-auto-columns: 70%; }
  .carousel-wrap { padding: 18px; }
  .browse-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .browse-card { padding: 16px; }
  .ai-grid { grid-template-columns: 1fr; }
  .open-strip { grid-template-columns: 1fr; }
  .contrib-card { padding: 28px 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .chat-body { max-height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
