/* ===========================
   AI Study + Productivity
   Dark / tan / teal theme
   Safe: never hides content without JS
=========================== */

:root{
  --bg0:#07090a;
  --bg1:#0b1010;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.08);
  --stroke: rgba(255,255,255,.12);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.66);

  --tan: #d9c6a5;
  --teal:#5ce1d6;

  --radius: 18px;
  --shadow: 0 20px 70px rgba(0,0,0,.45);
  --ease: cubic-bezier(.2,.9,.2,1);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 18% 8%, rgba(217,198,165,.20), transparent 60%),
    radial-gradient(900px 650px at 85% 15%, rgba(92,225,214,.16), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* IMPORTANT: never hide page by default */
.page{ min-height:100vh; }

/* Links */
a{ color: var(--tan); text-decoration: none; }
a:hover{ color: var(--teal); }

/* Top progress bar */
.progress{
  position:fixed;
  top:0; left:0;
  height:3px;
  width:100%;
  z-index:60;
  background: transparent;
}
.progress-bar{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--tan), var(--teal));
  box-shadow: 0 0 18px rgba(92,225,214,.25);
}

/* Layout */
.site-header{ padding: 22px 16px 10px; }
.main, .article{ padding: 10px 16px 70px; }

.topbar{
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(10px);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}

.brand{
  display:flex;
  gap: 12px;
  align-items:center;
  min-width: 0;
}

.logo{
  width: 42px; height: 42px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, rgba(217,198,165,.28), rgba(92,225,214,.18));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 12px 35px rgba(0,0,0,.35);
  font-weight: 900;
  letter-spacing: .5px;
}

.site-title{
  margin:0;
  font-size: 1.05rem;
  line-height: 1.1;
}
.site-subtitle{
  margin: 3px 0 0;
  font-size: .92rem;
  color: var(--muted);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}

.nav{
  display:flex;
  gap: 10px;
}
.nav-link{
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--text);
  transition: transform 220ms var(--ease), background 220ms var(--ease), border-color 220ms var(--ease);
}
.nav-link:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.18);
}
.nav-link.active{
  border-color: rgba(92,225,214,.35);
  box-shadow: 0 0 0 3px rgba(92,225,214,.08);
}

/* Buttons */
.btn{
  display:inline-block;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  box-shadow: 0 14px 40px rgba(0,0,0,.30);
  transition: transform 220ms var(--ease), background 220ms var(--ease), border-color 220ms var(--ease);
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.18);
}
.btn.ghost{
  background: transparent;
}

/* Hero */
.hero{
  max-width: 1100px;
  margin: 14px auto 0;
  display:grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 14px;
}
@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; }
  .site-subtitle{ max-width: 70vw; }
}

.hero-card, .card, .panel, .article-card{
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.25);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
}
.hero-card{ padding: 16px; }
.card{ padding: 14px; }
.panel{ padding: 16px; max-width:1100px; margin: 0 auto; }
.article-card{ max-width: 900px; margin: 0 auto; padding: 18px; }

.float-inner{ position: relative; }

.hero-title{
  margin: 0 0 6px;
  font-size: 1.55rem;
  letter-spacing: .2px;
}
.hero-text{
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.list{ margin: 10px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
.list-fancy li{ margin: 6px 0; }

.hero-actions{ display:flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Posts list */
.panel-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-title{ margin:0; font-size: 1.2rem; }
.panel-subtitle{ margin:0; color: var(--muted); font-size: .95rem; }

.post-list{ list-style:none; padding:0; margin: 0; display:flex; flex-direction:column; gap: 10px; }

.post-item{
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  padding: 14px;
  transition: transform 260ms var(--ease), background 260ms var(--ease), border-color 260ms var(--ease);
}
.post-item:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.06);
  border-color: rgba(92,225,214,.22);
}
.post-item a{
  display:block;
  font-weight: 800;
  letter-spacing: .2px;
  margin-bottom: 6px;
  color: var(--text);
}
.post-item a:hover{ color: var(--teal); }
.date{
  color: var(--muted);
  font-size: .93rem;
}

/* Article */
.back-link{
  display:inline-block;
  margin-bottom: 10px;
  color: var(--tan);
}
.article-title{
  margin: 0 0 6px;
  font-size: 1.8rem;
}
.lead{
  color: var(--muted);
  line-height: 1.65;
  font-size: 1.05rem;
}
.article h3{ margin: 22px 0 8px; }
.article p{ line-height: 1.7; color: rgba(255,255,255,.86); }

/* Images */
.visual{
  margin: 14px 0;
  border-radius: 16px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  box-shadow: 0 18px 55px rgba(0,0,0,.35);
}
.visual img{
  width:100%;
  height:auto;
  display:block;
  transition: transform 420ms var(--ease), filter 420ms var(--ease);
}
.visual:hover img{
  transform: scale(1.02);
  filter: brightness(1.06);
}
.visual figcaption{
  padding: 10px 12px;
  color: var(--muted);
  font-size: .95rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.hero-figure.compact figcaption{ display:none; }

/* Drawer */
.icon-btn{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: var(--text);
  width: 42px; height: 42px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform 220ms var(--ease), background 220ms var(--ease), border-color 220ms var(--ease);
}
.icon-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.20);
}
.burger{
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
  border-radius: 10px;
}
.burger::before, .burger::after{
  content:"";
  position:absolute;
  left:0;
  width:18px;
  height:2px;
  background: var(--text);
  border-radius:10px;
}
.burger::before{ top:-6px; }
.burger::after{ top:6px; }

.drawer{
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(360px, 88vw);
  background: rgba(10,12,12,.92);
  border-right: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(12px);
  transform: translateX(-102%);
  transition: transform 340ms var(--ease);
  z-index: 80;
  padding: 14px;
}
.drawer.on{ transform: translateX(0); }

.scrim{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease);
  z-index: 70;
}
.scrim.on{
  opacity: 1;
  pointer-events: auto;
}

.drawer-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.drawer-brand{
  display:flex;
  align-items:center;
  gap: 10px;
}
.drawer-title{ margin:0; font-weight: 900; }
.drawer-subtitle{ margin:4px 0 0; color: var(--muted); font-size: .95rem; }

.drawer-nav{ display:flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.drawer-link{
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text);
}
.drawer-link:hover{ border-color: rgba(92,225,214,.25); }

.drawer-section-title{
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: .95rem;
}
.drawer-post{
  display:block;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  margin: 8px 0;
  color: var(--text);
}
.drawer-post:hover{ border-color: rgba(217,198,165,.28); }

.drawer-footer{
  position:absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  color: var(--muted);
  font-size: .95rem;
}

/* To top button */
.to-top{
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.35);
  color: var(--text);
  cursor:pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events:none;
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
  z-index: 65;
}
.to-top.show{
  opacity: 1;
  transform: translateY(0);
  pointer-events:auto;
}

/* --------------------------------
   Reveal animations
   Safe rule: only hide elements if JS is running
--------------------------------- */
.has-js .reveal{
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}
.has-js .reveal.in{
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------
   Reduced motion accessibility
--------------------------------- */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .page{ opacity: 1 !important; transform: none !important; }
}
