/* ============================================================
   BTY Portal — portal.css  |  Warm Earthy Theme
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fcf8f1;
  --bg-deep: #f3ece6;
  --surface: #fffaf4;
  --surface-hover: #f7f0e8;
  --border: rgba(29,49,80,.12);
  --border-hover: rgba(29,49,80,.22);
  --text: #1d3150;
  --muted: rgba(29,49,80,.5);
  --accent: #e64c2e;
  --accent2: #f7d36e;
  --accent-navy: #1d3150;
  --radius: 20px;
  --radius-sm: 12px;
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Animated Background ---------- */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(29,49,80,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,49,80,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .18;
  animation: float 14s ease-in-out infinite;
}
.orb-1 { width: 700px; height: 700px; background: #f7d36e; top: -250px; left: -200px; animation-delay: 0s; }
.orb-2 { width: 550px; height: 550px; background: #e64c2e; bottom: -180px; right: -120px; animation-delay: -5s; }
.orb-3 { width: 450px; height: 450px; background: #1d3150; top: 40%; left: 50%; transform: translate(-50%,-50%); animation-delay: -9s; }

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(30px,-20px) scale(1.05); }
  66%       { transform: translate(-20px,30px) scale(.95); }
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 80px);
  height: 64px;
  background: rgba(252,248,241,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(29,49,80,.06);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-text { font-family: var(--font-head); font-size: 17px; letter-spacing: -.3px; color: var(--text); }
.brand-text strong { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-deep); }

.btn-admin {
  background: var(--accent-navy) !important;
  color: #fffaf4 !important;
  font-weight: 600;
  padding: 7px 18px !important;
  border-radius: 8px !important;
  transition: opacity .2s !important;
}
.btn-admin:hover { opacity: .85; background: var(--accent-navy) !important; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(60px, 10vw, 120px) clamp(20px, 5vw, 80px) 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(247,211,110,.25);
  border: 1px solid rgba(247,211,110,.5);
  color: #8a6520;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: .3px;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 20px;
  color: var(--text);
}

.grad-text {
  background: linear-gradient(135deg, #e64c2e, #f7d36e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  max-width: 560px;
  margin: 0 auto 36px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

/* Search */
.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 2px 0 rgba(29,49,80,.06);
  transition: border-color .2s, box-shadow .2s;
}
.hero-search:focus-within {
  border-color: rgba(230,76,46,.4);
  box-shadow: 0 0 0 3px rgba(230,76,46,.08);
}
.hero-search svg { color: var(--muted); flex-shrink: 0; }
.hero-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-body);
}
.hero-search input::placeholder { color: var(--muted); }

/* ---------- Filters ---------- */
.filters {
  position: relative;
  z-index: 1;
  padding: 32px clamp(20px, 5vw, 80px) 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-body);
  box-shadow: 0 1px 0 rgba(29,49,80,.06);
}
.chip:hover { background: var(--bg-deep); color: var(--text); border-color: var(--border-hover); }
.chip.active {
  background: var(--accent-navy);
  border-color: transparent;
  color: #fffaf4;
  box-shadow: 0 2px 8px rgba(29,49,80,.2);
}

/* ---------- Apps Grid ---------- */
.apps-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 28px clamp(20px, 5vw, 80px) 60px;
}

/* ---------- App Card ---------- */
.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid rgba(29,49,80,.12);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform .3s ease, border-color .3s, box-shadow .3s;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(29,49,80,.06);
}

.app-card:hover {
  transform: translateY(-6px);
  border-color: rgba(29,49,80,.22);
  box-shadow: 0 18px 40px -24px rgba(29,49,80,.35);
}

.card-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: var(--card-color, #e64c2e);
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0;
  transition: opacity .4s;
}
.app-card:hover .card-glow { opacity: .22; }

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--card-color, #e64c2e);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--card-color, #e64c2e) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-color, #e64c2e) 28%, transparent);
}

.card-body {
  flex: 1;
  position: relative;
  z-index: 1;
}
.card-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--card-color, #e64c2e);
  margin-bottom: 6px;
}
.card-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -.3px;
  color: var(--text);
}
.card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* Card footer row */
.card-arrow {
  position: relative;
  z-index: 1;
  align-self: flex-end;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(29,49,80,.15);
  background: var(--bg-deep);
  color: rgba(29,49,80,.6);
  transition: background .25s, border-color .25s, color .25s, transform .25s;
}
.app-card:hover .card-arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translate(2px, -2px);
}

/* ---------- Empty State ---------- */
.empty-state {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-state svg { margin-bottom: 16px; opacity: .4; }
.empty-state p { font-size: 15px; }

/* ---------- About ---------- */
.about {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 60px clamp(20px, 5vw, 40px);
  text-align: center;
}
.about h2 {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -.5px;
  color: var(--text);
}
.about p { color: var(--muted); line-height: 1.8; }
.about code {
  background: rgba(247,211,110,.25);
  color: #8a6520;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 13px;
  border: 1px solid rgba(247,211,110,.4);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  background: var(--surface);
}

/* ---------- Hidden ---------- */
.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .nav-links a:not(.btn-admin) { display: none; }
  .apps-grid { grid-template-columns: 1fr; }
}
