/* ABP Education Application Hub */
:root {
  --red: #d00000;            /* ABP logo red */
  --red-2: #a80012;
  --red-soft: #fdecec;
  --ink: #43434b;            /* ABP logo charcoal */
  --ink-2: #26262c;
  --text: #2b2b31;
  --muted: #6b6b75;
  --line: #ececf0;
  --bg: #fafafb;
  --card: #ffffff;
  --blue: #1f5fae;           /* ABP Learning blue */
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, .05), 0 2px 8px rgba(20, 20, 30, .05);
  --shadow-lg: 0 18px 40px -12px rgba(120, 0, 10, .25), 0 6px 16px rgba(20, 20, 30, .08);
  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: hidden; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.ico { width: 22px; height: 22px; flex: none; }

/* ---------- notices ---------- */
.notices { display: flex; align-items: center; gap: 14px; background: linear-gradient(90deg, var(--red-2), var(--red)); color: #fff; font-size: 13.5px; height: 38px; overflow: hidden; }
.notice-tag { flex: none; background: rgba(0,0,0,.18); height: 100%; display: flex; align-items: center; padding: 0 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 11.5px; }
.ticker { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: inline-flex; gap: 60px; white-space: nowrap; animation: ticker 40s linear infinite; padding-left: 100%; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track a, .ticker-track span { color: #fff; text-decoration: none; }
.ticker-track a:hover { text-decoration: underline; }
.ticker-track .sep { opacity: .5; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.82); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px rgba(20,20,30,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; min-width: 0; }
.brand-logo { height: 54px; width: auto; margin-left: -14px; }
.brand-divider { width: 1px; height: 30px; background: var(--line); }
.brand-text { font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.clock { text-align: right; line-height: 1.15; color: var(--ink); }
.clock span { white-space: nowrap; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.clock small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background:
  radial-gradient(900px 500px at 85% 40%, rgba(208,0,0,.09), transparent 60%),
  radial-gradient(700px 400px at 5% 0%, rgba(67,67,75,.07), transparent 60%),
  linear-gradient(180deg, #fff 0%, #fff7f7 100%); }
.globe { position: absolute; right: -6%; top: 50%; transform: translateY(-50%); width: 760px; height: 760px; max-width: 70vw; pointer-events: none; opacity: .95; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 30px; min-height: 520px; padding-top: 40px; padding-bottom: 90px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #f3d6d6; color: var(--red-2); font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(208,0,0,.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(208,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(208,0,0,0); } }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(38px, 5vw, 62px); line-height: 1.02; color: var(--ink-2); margin: 18px 0 14px; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--red); }
.lead { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 560px; margin: 0 0 26px; }
.search { position: relative; max-width: 560px; }
.search input { width: 100%; height: 58px; border-radius: 16px; border: 1px solid #e6e6ea; background: #fff; padding: 0 56px 0 52px; font: inherit; font-size: 16px; color: var(--text); box-shadow: 0 10px 30px -12px rgba(120,0,10,.18); transition: border-color .2s, box-shadow .2s; }
.search input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(208,0,0,.12), 0 10px 30px -12px rgba(120,0,10,.25); }
.search-ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font: 600 12px var(--sans); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 8px; background: #fafafa; }
.hero-stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-family: var(--serif); font-size: 30px; color: var(--red); line-height: 1; }
.hero-stats span { font-size: 12.5px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; height: 70px; background: var(--bg); clip-path: ellipse(75% 100% at 50% 100%); }

/* 3D orbit of entity logos - every size is set by portal.js from the space available */
.hero-3d { min-width: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.stage { position: relative; width: 100%; max-width: 560px; height: 300px; --cw: 160px; --ch: 96px; --core: 170px; }
.ring { position: absolute; inset: 0; }
.orbit-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.orbit-svg.back { z-index: 5; }
.orbit-svg.front { z-index: 55; }
.orbit-svg .track { fill: none; stroke: rgba(208,0,0,.6); stroke-width: 1.8; stroke-dasharray: 6 7; }
.orbit-svg .glow { fill: none; stroke: rgba(208,0,0,.08); stroke-width: 14; }
.orbit-svg .outer { fill: none; stroke: rgba(67,67,75,.22); stroke-width: 1.2; }
.orbit-svg .spark { fill: #d00000; }
.orbit-card { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .1); background: #fff; border: 1px solid #f0e3e3;
  box-shadow: 0 20px 40px -14px rgba(120,0,10,.35), inset 0 1px 0 #fff; display: flex; align-items: center; justify-content: center; padding: calc(var(--cw) * .08); text-decoration: none; will-change: transform, opacity; transition: box-shadow .2s; }
.orbit-card:hover { box-shadow: 0 24px 46px -12px rgba(120,0,10,.5), 0 0 0 3px rgba(208,0,0,.5); }
.orbit-card img { max-height: 70%; max-width: 86%; object-fit: contain; }
.orbit-card.dark { background: linear-gradient(135deg, #c10016, #8f0010); border-color: transparent; }
.orbit-card.ink, .entity.ink { background: linear-gradient(135deg, #3a3a43, #1d1d22); }
.entity.ink .code { background: var(--red); color: #fff; }
.orbit-card .code { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); background: var(--ink-2); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .08em; white-space: nowrap; }
.core { position: absolute; left: 50%; top: 50%; width: var(--core); height: var(--core); margin: calc(var(--core) / -2) 0 0 calc(var(--core) / -2); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #fff5f5 60%, #fde6e6);
  box-shadow: 0 30px 60px -20px rgba(160,0,15,.45), inset 0 -10px 30px rgba(208,0,0,.08); display: flex; align-items: center; justify-content: center; z-index: 50; animation: breathe 6s ease-in-out infinite; }
.core img { width: 86%; }
@keyframes breathe { 50% { transform: scale(1.04); } }
@keyframes float { 50% { transform: translateY(-12px); } }
.abpl-logo { font-family: var(--serif); font-weight: 700; line-height: .9; text-align: center; }
.abpl-logo b { display: block; color: var(--red); font-size: 34px; letter-spacing: .02em; }
.abpl-logo i { display: block; font-style: normal; color: var(--blue); font-size: 24px; }

/* ---------- main ---------- */
.main { position: relative; padding-bottom: 60px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 26px; position: sticky; top: 76px; z-index: 30; padding: 12px 0; background: linear-gradient(var(--bg) 70%, transparent); }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 16px; font: 600 13.5px var(--sans); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; transition: all .2s; }
.chip .ico { width: 16px; height: 16px; }
.chip:hover { border-color: #e9b9b9; color: var(--red-2); }
.chip.active { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }
.section { margin-bottom: 44px; scroll-margin-top: 140px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--ink-2); margin: 0; display: flex; align-items: center; gap: 10px; }
.section-head h2 .ico { width: 26px; height: 26px; color: var(--red); }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.section-head .count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* link cards with 3D tilt */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; perspective: 1000px; }
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; perspective: 1000px; }
.lcard { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-sm); transform-style: preserve-3d; transition: transform .25s ease, box-shadow .25s ease, border-color .25s; will-change: transform; overflow: hidden; }
.lcard:hover, .lcard:focus-visible { box-shadow: var(--shadow-lg); border-color: #f1cccc; outline: none; }
.lcard::after { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.55), transparent 40%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.lcard:hover::after { opacity: 1; }
.lcard .tile { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none;
  background: linear-gradient(135deg, #e01a1a, #a00010); box-shadow: 0 8px 18px -6px rgba(176,0,16,.55); transform: translateZ(30px); }
.lcard .tile.alt { background: linear-gradient(135deg, #5a5a64, #2c2c33); box-shadow: 0 8px 18px -6px rgba(30,30,40,.5); }
.lcard .tile.logo { background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 16px -8px rgba(20,20,30,.25); padding: 5px; overflow: hidden; }
.lcard .tile.logo img { width: 100%; height: 100%; object-fit: contain; }
.lcard .tile.blue { background: linear-gradient(135deg, #2d73c9, #174a8c); box-shadow: 0 8px 18px -6px rgba(23,74,140,.5); }
.lcard .body { min-width: 0; flex: 1; transform: translateZ(20px); }
.lcard h3 { margin: 2px 0 4px; font-size: 15.5px; font-weight: 650; color: var(--ink-2); padding-right: 16px; }
.lcard p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lcard .ext { position: absolute; right: 14px; top: 14px; color: #c9c9d1; transition: color .2s, transform .2s; }
.lcard .ext .ico { width: 17px; height: 17px; }
.lcard:hover .ext { color: var(--red); transform: translate(2px, -2px); }
.lcard .tag { display: inline-block; margin-top: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--red-2); background: var(--red-soft); padding: 2px 8px; border-radius: 999px; }
.lcard .host { display: block; font-size: 11.5px; color: #a3a3ad; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.featured-grid .lcard { padding: 22px; min-height: 120px; background: linear-gradient(160deg, #fff 0%, #fff 55%, #fff3f3 100%); }
.featured-grid .lcard .tile { width: 54px; height: 54px; border-radius: 15px; }
.featured-grid .lcard .tile .ico { width: 26px; height: 26px; }
.featured-grid .lcard h3 { font-size: 17px; }
/* Quick Access cards with a logo: logo panel on top, name below */
.featured-grid .lcard.has-logo { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 18px 18px; text-align: center; }
.featured-grid .lcard.has-logo .tile.logo { width: 100%; height: 92px; border-radius: 12px; padding: 14px 18px; background: #fff;
  border: 1px solid #f0e6e6; box-shadow: inset 0 -12px 24px -18px rgba(208,0,0,.25); }
.featured-grid .lcard.has-logo h3 { justify-content: center; padding: 0; }
.featured-grid .lcard.has-logo .host { margin-top: 2px; }
.featured-grid .lcard.has-logo p { -webkit-line-clamp: 1; }
.featured-grid .lcard.has-logo .tag { align-self: center; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px) rotateX(8deg); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

.no-results { text-align: center; padding: 60px 20px; color: var(--muted); }
.no-results .nr-ico { display: inline-flex; width: 64px; height: 64px; border-radius: 50%; background: var(--red-soft); color: var(--red); align-items: center; justify-content: center; }
.no-results h3 { color: var(--ink-2); font-family: var(--serif); font-size: 26px; margin: 14px 0 6px; }
mark { background: #ffe3a3; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- footer ---------- */
.footer { background: radial-gradient(900px 300px at 50% 0%, #3a3a43, #232329); color: #e8e8ee; padding: 56px 0 26px; margin-top: 30px; }
.footer-head { text-align: center; margin-bottom: 30px; }
.footer-head h2 { font-family: var(--serif); font-size: 34px; margin: 0; color: #fff; }
.footer-head p { margin: 6px 0 0; color: #b6b6c2; font-size: 14px; }
.entity-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; perspective: 900px; }
.entity { position: relative; background: #fff; border-radius: 18px; height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; padding: 16px 14px 26px;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5); transform-style: preserve-3d; }
.entity:hover { transform: translateY(-8px) rotateX(10deg); box-shadow: 0 26px 40px -16px rgba(0,0,0,.6), 0 0 0 3px rgba(208,0,0,.6); }
.entity img { max-height: 62px; max-width: 88%; object-fit: contain; transform: translateZ(25px); }
.entity.dark { background: linear-gradient(135deg, #c10016, #8f0010); }
.entity .ename { position: absolute; bottom: 9px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.entity.dark .ename { color: #ffd9d9; }
.entity .code { position: absolute; top: 9px; right: 10px; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #fff; background: var(--red); padding: 2px 7px; border-radius: 999px; }
.entity.dark .code { background: #fff; color: var(--red-2); }
.footer-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.footer-logo { height: 48px; background: #fff; border-radius: 10px; padding: 0 4px; }
.footer-meta { flex: 1; font-size: 13.5px; min-width: 220px; }
.footer .muted { color: #a9a9b5; }
.support { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 4px; }
.support a { color: #fff; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.support a:hover { color: #ffb3b3; }
.support .ico { width: 16px; height: 16px; }
.footer-right { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.admin-link { color: #8e8e9a; text-decoration: none; font-size: 12px; border: 1px solid rgba(255,255,255,.15); padding: 4px 10px; border-radius: 6px; }
.admin-link:hover { color: #fff; border-color: rgba(255,255,255,.4); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; min-height: 0; padding-bottom: 80px; }
  .hero-3d { margin-top: 6px; }
  .globe { right: -30%; top: auto; bottom: -10%; transform: none; max-width: 120vw; opacity: .6; }
  .entity-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .header-inner { height: 64px; }
  .brand-logo { height: 42px; margin-left: -10px; }
  .brand-divider, .clock small { display: none; }
  .brand-text { font-size: 17px; }
  .chips { top: 64px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chip { flex: none; }
  .orbit-card .code { font-size: 9px; padding: 1px 6px; bottom: -8px; }
  .hero-inner { padding-bottom: 92px; }
  .search kbd { display: none; }
  .entity-row { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .featured-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .featured-grid .lcard.has-logo { padding: 12px; gap: 8px; }
  .featured-grid .lcard.has-logo .tile.logo { height: 64px; padding: 8px 10px; }
  .featured-grid .lcard.has-logo h3 { font-size: 14px; }
  .featured-grid .lcard.has-logo p, .featured-grid .lcard.has-logo .host, .featured-grid .lcard .ext { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
.orbit-card .abpl-logo b { font-size: calc(var(--cw) * .2); }
.orbit-card .abpl-logo i { font-size: calc(var(--cw) * .14); }
@media (max-width: 480px) {
  .brand { gap: 10px; }
  .brand-text { font-size: 15px; line-height: 1.15; max-width: 46vw; }
  .clock span { font-size: 15px; }
}
