/* Academix Writers styles */
:root{
  --bg:#f7fafc;
  --bg-alt:#ffffff;
  --text:#0f1e2e;
  --muted:#5a6b7b;
  --brand:#1f6f8b;
  --brand-2:#33a06f;
  --card:#ffffff;
  --border:#e6ecf2;
  --shadow:0 10px 30px rgba(15,30,46,.08);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:var(--text);background:var(--bg)}
a{color:var(--brand);text-decoration:none}
.container{max-width:1100px;margin:0 auto;padding:0 20px}

/* Header */
.site-header{position:sticky;top:0;background:var(--bg-alt);border-bottom:1px solid var(--border);z-index:50}
.header-inner{display:flex;align-items:center;justify-content:space-between;min-height:64px}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;color:var(--text)}
.brand-text strong{color:var(--text)}
.nav ul{display:flex;gap:18px;align-items:center;margin:0;padding:0;list-style:none}
.nav .btn-sm{padding:.55rem .9rem;border-radius:12px;background:var(--brand-2);color:#fff;border:1px solid transparent}
.nav-toggle{display:none;border:1px solid var(--border);background:#fff;border-radius:10px;padding:.35rem .55rem}

/* Hero */
.hero{background:linear-gradient(180deg,#fff, #f5fbff);padding:60px 0 40px}
.hero-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:30px;align-items:center}
.hero-copy h1{font-size:40px;line-height:1.1;margin:0 0 10px}
.hero-copy p{color:var(--muted);font-size:18px;margin:0 0 14px}
.cta-row{display:flex;gap:12px;flex-wrap:wrap;margin:16px 0}
.btn{display:inline-block;border:1px solid transparent;background:var(--brand-2);color:#fff;padding:.85rem 1.1rem;border-radius:14px;font-weight:700;box-shadow:var(--shadow);cursor:pointer}
.btn-lg{padding:1rem 1.25rem}
.btn-outline{background:#fff;color:var(--text);border:1px solid var(--border)}
.trust-badges{display:flex;gap:16px;flex-wrap:wrap;padding:0;margin:18px 0 0;list-style: '✓  '}
.hero-illustration{position:relative;min-height:260px;background:#e9f6ff;border-radius:24px;box-shadow:var(--shadow)}
.grad-cap{position:absolute;right:24px;top:24px;width:120px;height:80px;background:var(--text);border-radius:6px 6px 2px 2px}
.book{position:absolute;left:24px;bottom:24px;width:220px;height:120px;background:#17374a;border-radius:10px}
.code-brackets{position:absolute;right:34px;bottom:30px;font-weight:800;font-size:34px;color:var(--brand-2)}

/* Sections */
.section{padding:60px 0}
.section.alt{background:var(--bg-alt)}
.section-title{font-size:28px;margin:0 0 16px}
.section-subtitle{color:var(--muted);margin:0 0 24px}
.grid{display:grid;gap:18px}
.cards-2{grid-template-columns:repeat(2,1fr)}
.cards-3{grid-template-columns:repeat(3,1fr)}
.card{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:18px;box-shadow:var(--shadow)}
.card h3,.card h4{margin:0 0 8px}
.card p{margin:0 0 12px;color:var(--muted)}
.card-icon{font-size:26px}
.sample-card .btn-sm{padding:.55rem .8rem;border-radius:12px}

/* About */
.about-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:24px;align-items:start}
.checklist{padding-left:20px}
.checklist li{margin:8px 0}
.about-stats{display:grid;gap:14px}
.stat{background:#0f2a3a;color:#fff;padding:16px;border-radius:14px;box-shadow:var(--shadow)}
.stat span{display:block;font-size:24px;font-weight:800}

/* Contact */
.contact-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:24px}
.form{display:grid;gap:14px}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form label{display:grid;gap:6px;font-weight:600}
.form input,.form textarea,.form select{padding:.8rem;border:1px solid var(--border);border-radius:12px;background:#fff}
.form-status{min-height:22px;color:var(--brand)}
.req{color:#e63946;margin-left:6px}
.deliverables{border:1px dashed var(--border);border-radius:12px;padding:10px 12px;display:grid;gap:6px}
.agree{display:flex;align-items:center;gap:10px}

/* Modals (Order, Sign In, etc) */
.modal-wrap{position:fixed;inset:0;display:none;background:rgba(15,30,46,.5);z-index:100}
.modal-wrap.open{display:block}
.modal-container{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:20px}
.modal-card{background:#f0f8f5;max-height:90vh;overflow-y:auto;border-radius:18px;padding:24px;box-shadow:var(--shadow);width:min(900px,95vw);position:relative}
.modal-card .close{position:absolute;top:10px;right:12px;background:transparent;border:1px solid var(--border);border-radius:12px;padding:.2rem .6rem;cursor:pointer}
.auth-card{width:min(400px, 95vw)}
.modal-switch{text-align:center;margin-top:10px;color:var(--muted)}
.modal-switch a{font-weight:600}

/* Footer */
.site-footer{background:#0f1e2e;color:#b8c7d6;margin-top:40px}
.footer-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:20px;padding:28px 20px}
.footer-links a{display:inline-block;margin:4px 10px 4px 0;color:#e7f0f7}
.legal{border-top:1px solid rgba(255,255,255,.08);text-align:center;padding:10px 0;color:#9fb1c2}
.footer-contact { margin-top: 1rem; }
.footer-contact p { margin: 4px 0; font-size: 14px; }
.footer-contact p strong { color: #fff; }
.footer-contact a { color: #e7f0f7; text-decoration: underline; }
.footer-contact a:hover { text-decoration: underline; }
.footer-countries {
  margin-top: 12px;
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: var(--muted);
}

/* Order Tracker */
.order-tracker {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: flex;
  justify-content: space-between;
  position: relative;
}
.order-tracker::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.tracker-step {
  position: relative;
  text-align: center;
  width: 12%;
}
.tracker-step .step-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  margin: 0 auto 8px;
  position: relative;
  z-index: 1;
  transition: all .3s ease;
  display: flex; align-items: center; justify-content: center;
}
.tracker-step .step-label { font-size: 12px; color: var(--muted); }
.tracker-step.complete .step-icon { background: var(--brand-2); border-color: var(--brand-2); color: white; }
.tracker-step.complete .step-icon::after { content: '✓'; font-weight: bold; }
.tracker-step.active .step-icon { background: var(--brand); border-color: var(--brand); transform: scale(1.2); }
.tracker-step.active .step-label { color: var(--text); font-weight: 600; }

/* Utilities & State */
.logged-in-only { display: none !important; }
body.logged-in .logged-out-only { display: none !important; }
body.logged-in .logged-in-only { display: inline-block !important; }
body.logged-in .nav .logged-in-only { display: list-item !important; }

/* Utilities */
.btn-primary{background:var(--brand);}
.link{color:var(--brand);text-decoration:underline}
.socials{margin-top:14px;display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.socials a {
  background: #e9f6ff;
  color: var(--brand);
  padding: .4rem .8rem;
  border-radius: 10px;
  font-weight: 600;
  transition: all .2s ease;
}
.socials a:hover {
  background: var(--brand);
  color: #fff;
}

/* Social Icons (Footer) */
.footer-socials .social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 4px;
  border-radius: 50%;
  background-color: #e7f0f7; /* This color will be used for the icon shape */
  transition: background-color 0.2s ease;
  -webkit-mask-size: 20px 20px;
  mask-size: 20px 20px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.footer-socials .social-icon:hover {
  background-color: var(--brand);
}

/* Set the mask for each icon */
.icon-github { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.91 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.91 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z'/%3E%3C/svg%3E"); }
.icon-facebook { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.879V14.89h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.989C18.343 21.128 22 16.991 22 12z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.879V14.89h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.989C18.343 21.128 22 16.991 22 12z'/%3E%3C/svg%3E"); }
.icon-instagram { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.85s-.011 3.584-.069 4.85c-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07s-3.584-.012-4.85-.07c-3.252-.148-4.771-1.691-4.919-4.919-.058-1.265-.069-1.645-.069-4.85s.011-3.584.069-4.85c.149-3.225 1.664-4.771 4.919-4.919 1.266-.057 1.644-.07 4.85-.07zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948s.014 3.667.072 4.947c.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072s3.667-.014 4.947-.072c4.358-.2 6.78-2.618 6.98-6.98.059-1.281.073-1.689.073-4.948s-.014-3.667-.072-4.947c-.2-4.358-2.618-6.78-6.98-6.98-1.281-.059-1.689-.073-4.948-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.162 6.162 6.162 6.162-2.759 6.162-6.162-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4s1.791-4 4-4 4 1.79 4 4-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44 1.441-.645 1.441-1.44-.645-1.44-1.441-1.44z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.85s-.011 3.584-.069 4.85c-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07s-3.584-.012-4.85-.07c-3.252-.148-4.771-1.691-4.919-4.919-.058-1.265-.069-1.645-.069-4.85s.011-3.584.069-4.85c.149-3.225 1.664-4.771 4.919-4.919 1.266-.057 1.644-.07 4.85-.07zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948s.014 3.667.072 4.947c.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072s3.667-.014 4.947-.072c4.358-.2 6.78-2.618 6.98-6.98.059-1.281.073-1.689.073-4.948s-.014-3.667-.072-4.947c-.2-4.358-2.618-6.78-6.98-6.98-1.281-.059-1.689-.073-4.948-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.162 6.162 6.162 6.162-2.759 6.162-6.162-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4s1.791-4 4-4 4 1.79 4 4-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44 1.441-.645 1.441-1.44-.645-1.44-1.441-1.44z'/%3E%3C/svg%3E"); }
.icon-groupme { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1.2 14.4c-1.92 0-3.6-1.08-4.56-2.64l1.44-1.08c.6.96 1.68 1.56 2.88 1.56 1.56 0 2.64-1.08 2.64-2.4 0-1.92-2.16-2.4-3.6-2.4h-1.2v-2.4h1.2c1.2 0 3.12-.36 3.12-2.16 0-1.08-.84-1.8-2.04-1.8-1.08 0-1.92.6-2.28 1.44l-1.44-.96C6.24 7.08 7.8 6 9.6 6c2.4 0 4.08 1.44 4.08 3.48 0 1.44-.84 2.52-2.16 3.12v.12c1.68.48 2.64 1.8 2.64 3.36 0 2.4-1.92 4.32-4.56 4.32z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1.2 14.4c-1.92 0-3.6-1.08-4.56-2.64l1.44-1.08c.6.96 1.68 1.56 2.88 1.56 1.56 0 2.64-1.08 2.64-2.4 0-1.92-2.16-2.4-3.6-2.4h-1.2v-2.4h1.2c1.2 0 3.12-.36 3.12-2.16 0-1.08-.84-1.8-2.04-1.8-1.08 0-1.92.6-2.28 1.44l-1.44-.96C6.24 7.08 7.8 6 9.6 6c2.4 0 4.08 1.44 4.08 3.48 0 1.44-.84 2.52-2.16 3.12v.12c1.68.48 2.64 1.8 2.64 3.36 0 2.4-1.92 4.32-4.56 4.32z'/%3E%3C/svg%3E"); }
.icon-twitter { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E"); }
.icon-youtube { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E"); }
.icon-wechat { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.875 3.187C7.63 3.187 3.375 6.74 3.375 11.124c0 2.48 1.32 4.695 3.39 6.11L5.5 21.5l4.5-2.25c.945.3 1.95.465 3.015.465 5.245 0 9.5-3.555 9.5-7.935s-4.255-7.937-9.64-7.937zm-1.26 2.25c.585 0 1.125.465 1.125 1.05 0 .585-.54 1.05-1.125 1.05-.585 0-1.125-.465-1.125-1.05s.54-1.05 1.125-1.05zm-3.75 0c.585 0 1.125.465 1.125 1.05 0 .585-.54 1.05-1.125 1.05-.585 0-1.125-.465-1.125-1.05s.54-1.05 1.125-1.05z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.875 3.187C7.63 3.187 3.375 6.74 3.375 11.124c0 2.48 1.32 4.695 3.39 6.11L5.5 21.5l4.5-2.25c.945.3 1.95.465 3.015.465 5.245 0 9.5-3.555 9.5-7.935s-4.255-7.937-9.64-7.937zm-1.26 2.25c.585 0 1.125.465 1.125 1.05 0 .585-.54 1.05-1.125 1.05-.585 0-1.125-.465-1.125-1.05s.54-1.05 1.125-1.05zm-3.75 0c.585 0 1.125.465 1.125 1.05 0 .585-.54 1.05-1.125 1.05-.585 0-1.125-.465-1.125-1.05s.54-1.05 1.125-1.05z'/%3E%3C/svg%3E"); }

/* Social Login Buttons */
.social-login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  margin: 16px 0;
  font-size: 12px;
  font-weight: 600;
}
.social-login-divider::before,
.social-login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.social-login-divider:not(:empty)::before { margin-right: .5em; }
.social-login-divider:not(:empty)::after { margin-left: .5em; }

.social-login { display: grid; gap: 10px; }
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: .7rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-weight: 600;
}
.btn-social:hover { background: var(--bg); }
.btn-social svg { width: 20px; height: 20px; }

/* Mega Menu (Library) */
.nav-item-dropdown {
  position: relative;
}
.nav-item-dropdown > a {
  padding: .55rem .9rem;
}
.nav-item-dropdown .mega-menu-wrap {
  position: absolute;
  top: 100%;
  right: 0;
  width: min(1100px, 95vw);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  z-index: 1000;
  transform: translateY(10px);
}
.nav-item-dropdown:hover .mega-menu-wrap {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.mega-menu-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.mega-menu-col h6 {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.mega-menu-section {
  margin-bottom: 20px;
}
.mega-menu-section:last-child {
  margin-bottom: 0;
}
.mega-menu-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.mega-menu-links li strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
}
.mega-menu-links ul {
  list-style: none;
  padding: 0 0 0 10px;
  margin: 0;
  display: grid;
  gap: 4px;
}
.mega-menu-links ul li a {
  color: var(--muted);
  font-size: 14px;
  padding: 2px 0;
  display: block;
}
.mega-menu-links ul li a:hover {
  color: var(--brand-2);
}

/* Library Page */
.library-page-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  align-items: flex-start;
}

.library-filters {
  position: sticky;
  top: 85px; /* header height + some margin */
  background: #f0f8f5; /* Grayish-greenish */
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.library-filters h3 {
  margin-top: 0;
  margin-bottom: 16px;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: .7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

#resultsCount {
    font-size: 14px;
    color: var(--muted);
    margin-top: 16px;
    border-top: 1px dashed var(--border);
    padding-top: 12px;
}

#libraryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.library-item-card { display: flex; flex-direction: column; }
.library-item-card h4 { margin-bottom: 4px; }
.library-item-card .item-author { font-size: 14px; font-style: italic; margin-top: 0; }
.library-item-card .item-description { flex-grow: 1; font-size: 15px; }
.library-item-card .item-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.item-availability { font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.item-availability.free { background: #e3fcef; color: var(--brand-2); }
.item-availability.for-sale { background: #fff4e5; color: #f59e0b; }
.library-item-card .item-actions { margin-top: 12px; text-align: right; }
.library-item-card .item-actions {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.item-price {
    font-weight: 700;
    font-size: 16px;
}
.item-price del {
    font-weight: 400;
    color: var(--muted);
    font-size: 14px;
    margin-right: 4px;
}

/* Responsive */
@media (max-width: 900px){
  .hero-grid,.about-grid,.contact-grid{grid-template-columns:1fr}
  .cards-2{grid-template-columns:1fr}
  .cards-3{grid-template-columns:1fr}
  .form-row{grid-template-columns:1fr}
  .nav-toggle{display:inline-block}
  .nav ul{display:none;position:absolute;right:20px;top:64px;background:#fff;border:1px solid var(--border);border-radius:12px;padding:10px 14px;box-shadow:var(--shadow);flex-direction:column;min-width:200px}
  .nav ul.open{display:flex}

  .nav-item-dropdown {
    width: 100%;
  }
  .nav-item-dropdown > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  .nav-item-dropdown > a::after {
    content: '▼';
    font-size: 10px;
    margin-left: 8px;
    transition: transform .2s ease;
  }
  .nav-item-dropdown.open > a::after {
    transform: rotate(180deg);
  }
  .nav-item-dropdown .mega-menu-wrap {
    display: none;
    position: static;
    width: 100%;
    transform: none;
    border: none;
    box-shadow: none;
    padding: 10px 0 0 15px;
    opacity: 1;
    visibility: visible;
    background: transparent;
  }
  .nav-item-dropdown.open .mega-menu-wrap {
    display: block;
  }
  .mega-menu-content {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .library-page-grid {
    grid-template-columns: 1fr;
  }
  .library-filters {
    position: static;
    margin-bottom: 24px;
  }
}

/* Force hide logged-out elements when user is logged in */
body.user-logged-in .logged-out-only {
    display: none !important;
}

/* Force show logged-in elements when user is logged in */
body.user-logged-in .logged-in-only {
    display: block !important;
}