:root {
  --color-bg: #f7f5f2;
  --color-surface: #ffffff;
  --color-text: #16151a;
  --color-text-muted: #6b6873;
  --color-border: #ebe8e2;
  --color-accent: #7c3aed;
  --color-accent-2: #ec4899;
  --color-danger: #d33d33;
  --color-success: #1f8a4c;
  --gradient-accent: linear-gradient(120deg, #edc93a, #ec4899);
  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hero-height: 560px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Full-bleed shell: edge-to-edge width with responsive horizontal
   padding, instead of a narrow fixed-width centered column. */
.shell {
  width: 100%;
  max-width: 1880px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5.5vw, 88px);
}

a { color: var(--color-text); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-accent); }

/* ---------- Ambient animated background ---------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  animation: floatOrb 22s ease-in-out infinite;
}
.orb-1 { width: 420px; height: 420px; background: #3aed52; top: -120px; left: -100px; animation-duration: 26s; }
.orb-2 { width: 380px; height: 380px; background: #ec4848; top: 10%; right: -140px; animation-duration: 30s; animation-delay: -6s; }
.orb-3 { width: 320px; height: 320px; background: #38bdf8; bottom: -100px; left: 30%; animation-duration: 24s; animation-delay: -12s; }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, 30px) scale(1.08); }
  66% { transform: translate(-30px, 20px) scale(0.95); }
}

/* Everything else sits above the ambient background */
.site-header, main, .site-footer { position: relative; z-index: 1; }

/* ---------- Scroll-reveal utility ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

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

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(22, 21, 26, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
  transition: padding 0.3s ease;
}
.site-header.scrolled .header-inner { padding-top: 14px; padding-bottom: 14px; }

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--color-text); }
.brand-mark {
  background: red;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1rem;
}

.nav { display: flex; align-items: center; gap: 24px; }
.nav a {
  font-weight: 600;
  font-size: 0.92rem;
  position: relative;
  padding: 4px 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
  border-radius: 2px;
}
.nav a:hover::after { transform: scaleX(1); }
.nav-user { color: var(--color-text-muted); font-size: 0.88rem; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--color-text);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s ease;
}
.btn:hover {
  background: var(--gradient-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
}
.btn:active { transform: translateY(0) scale(0.97); box-shadow: none; }
.btn-small { padding: 8px 16px; font-size: 0.82rem; }
.btn-full { width: 100%; }
.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #a92e26; box-shadow: 0 10px 24px rgba(211, 61, 51, 0.25); }
.btn-outline { background: transparent; color: var(--color-text); border: 1.5px solid var(--color-border); }
.btn-outline:hover { background: var(--color-text); color: #fff; border-color: var(--color-text); box-shadow: none; }

.link-button {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0;
  font-family: var(--font-sans);
  transition: opacity 0.2s ease;
}
.link-button:hover { text-decoration: underline; opacity: 0.8; }
.link-danger { color: var(--color-danger); }
.inline-form { display: inline; }

.no-underline,
.no-underline:hover,
.no-underline::before,
.no-underline::after {
  text-decoration: none !important;
  content: none !important;
}

/* ---------- Flash / error messages ---------- */
.flash {
  margin: 24px 0 0;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  animation: slideDown 0.35s var(--ease) both;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.flash-success { background: #e9f8ee; color: var(--color-success); border: 1px solid #bfe8cd; }
.flash-error { background: #fdecea; color: var(--color-danger); border: 1px solid #f3c3bd; }

.error-list {
  background: #fdecea;
  border: 1px solid #f3c3bd;
  color: var(--color-danger);
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin: 0 0 18px;
  animation: slideDown 0.3s var(--ease) both;
}

/* ---------- Page intro (homepage headline) ---------- */
.page-intro { padding: 56px 0 40px; }
.intro-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 12px;
}
.intro-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.02em;
}

.empty-state { color: var(--color-text-muted); padding: 40px 0; text-align: center; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 10px;
  display: inline-block;
}

/* ---------- Hero grid: 1 big feature + 3 side tiles matching its height ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 22px;
  height: var(--hero-height);
  margin-bottom: 56px;
}
.hero-grid.no-side { grid-template-columns: 1fr; }

.hero-tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  box-shadow: 0 20px 50px -20px rgba(22, 21, 26, 0.35);
}
.hero-tile-link { display: block; width: 100%; height: 100%; color: #fff; }
.hero-tile-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.hero-tile:hover .hero-tile-image { transform: scale(1.06); }
.placeholder-gradient { background: linear-gradient(135deg, #7c3aed, #ec4899, #38bdf8); background-size: 200% 200%; animation: gradientShift 8s ease infinite; position: relative; display: flex; align-items: center; justify-content: center; }
.placeholder-gradient span { color: rgba(255,255,255,0.85); font-family: var(--font-display); font-weight: 800; }
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero-tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 8, 20, 0.92) 0%, rgba(10, 8, 20, 0.25) 55%, rgba(10, 8, 20, 0) 80%);
}
.hero-tile-content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 30px;
  z-index: 2;
}
.tile-tag {
  display: inline-block;
  background: var(--gradient-accent);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.hero-feature h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  font-weight: 800;
  margin: 0 0 10px;
  line-height: 1.15;
}
.hero-excerpt { font-size: 0.98rem; opacity: 0.85; margin: 0 0 12px; max-width: 480px; }
.tile-meta { font-size: 0.8rem; opacity: 0.75; font-weight: 500; }

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
}
.hero-side-item { flex: 1; min-height: 0; }
.hero-side-item h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.25;
}
.hero-side-item .hero-tile-content { padding: 18px 20px; }

/* ---------- Section divider ---------- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0 30px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
}
.section-divider::before, .section-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }

/* ---------- Post grid (secondary posts) ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 70px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(22, 21, 26, 0.05);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.post-card:hover { transform: translateY(-6px); box-shadow: 0 22px 40px -18px rgba(22, 21, 26, 0.25); }
.post-card-image-link { display: block; overflow: hidden; height: 170px; }
.post-card-image { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.post-card-image-link:hover .post-card-image { transform: scale(1.08); }
.post-card-body { padding: 20px 22px 24px; }
.post-card-body h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin: 0 0 8px; line-height: 1.3; }
.post-card-body h3 a:hover { color: var(--color-accent); }
.post-meta { color: var(--color-text-muted); font-size: 0.82rem; margin: 0 0 10px; }
.post-excerpt { margin: 0 0 12px; color: #333; font-size: 0.95rem; }
.read-more {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-accent);
  display: inline-block;
  transition: transform 0.2s ease, color 0.2s ease;
}
.read-more:hover { color: var(--color-text); transform: translateX(4px); }

/* ---------- Single post ---------- */
.single-post { padding: 44px 0 8px; max-width: 760px; margin: 0 auto; }
.single-post h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; line-height: 1.12; margin: 0 0 12px; letter-spacing: -0.01em; }
.byline { font-weight: 700; color: var(--color-text); }
.admin-actions { margin: 20px 0; display: flex; gap: 10px; }
.single-post-image { margin: 28px 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 50px -24px rgba(22, 21, 26, 0.4); }
.single-post-image img { width: 100%; display: block; transition: transform 0.6s var(--ease); }
.single-post-image:hover img { transform: scale(1.02); }
.post-content { margin-top: 26px; font-size: 1.1rem; color: #222; }
.post-content p { margin: 0 0 22px; }

/* ---------- Comments ---------- */
.comments-section { padding: 10px 0 80px; max-width: 760px; margin: 0 auto; }

.comment-form, .reply-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
.reply-form { margin: 14px 0 0; }
.reply-form.hidden { display: none; }

textarea, input[type="text"], input[type="email"], input[type="password"], input[type="file"] {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea:focus, input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}
input[type="file"] { padding: 9px 14px; }

.login-prompt { color: var(--color-text-muted); padding: 12px 0 28px; }

.comment-thread { display: flex; flex-direction: column; gap: 18px; }
.comment {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.comment:hover { box-shadow: 0 10px 26px -14px rgba(22, 21, 26, 0.2); transform: translateY(-1px); }
.comment.reply { background: #faf9fc; }
.replies { margin-top: 16px; padding-left: 24px; border-left: 2px solid var(--color-border); display: flex; flex-direction: column; gap: 16px; }

.comment-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.comment-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.92rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.comment:hover .comment-avatar { transform: scale(1.1) rotate(-4deg); }
.comment-author { font-weight: 700; font-size: 0.94rem; display: block; }
.comment-date { color: var(--color-text-muted); font-size: 0.8rem; }
.comment-body { margin: 0 0 10px; white-space: pre-wrap; font-size: 0.98rem; }
.comment-actions { display: flex; gap: 16px; }

.badge {
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.66rem;
  padding: 2px 9px;
  border-radius: 999px;
  vertical-align: middle;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.author-badge { color: var(--color-accent); }

/* ---------- Auth forms ---------- */
.auth-form-wrap {
  max-width: 440px;
  margin: 60px auto;
  padding: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -30px rgba(22, 21, 26, 0.25);
}
.post-form-wrap { max-width: 760px; }
.auth-form-wrap h1 { font-family: var(--font-display); margin-top: 0; font-size: 1.8rem; font-weight: 800; }
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { font-weight: 700; font-size: 0.86rem; margin-top: 12px; }
.auth-form .hint { font-weight: 400; color: var(--color-text-muted); }
.auth-form button { margin-top: 22px; }
.auth-switch { margin-top: 20px; text-align: center; color: var(--color-text-muted); font-size: 0.9rem; }

.checkbox-label { display: flex; align-items: center; gap: 6px; font-weight: 400 !important; font-size: 0.85rem; margin-top: 8px !important; color: var(--color-text-muted); }
.checkbox-label input { width: auto; }
.current-image-preview { margin: 8px 0 14px; }
.current-image-preview img { max-width: 260px; border-radius: var(--radius-sm); display: block; border: 1px solid var(--color-border); }

/* ---------- Admin dashboard ---------- */
.admin-dashboard { padding: 44px 0 80px; }
.admin-dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.admin-dashboard-header h1 { font-family: var(--font-display); margin: 0; font-size: 1.9rem; font-weight: 800; }

.admin-post-list { display: flex; flex-direction: column; gap: 14px; }
.admin-post-row {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.admin-post-row:hover { transform: translateX(4px); box-shadow: 0 10px 26px -16px rgba(22, 21, 26, 0.2); }
.admin-thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.admin-thumb.placeholder-gradient { }
.admin-post-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.admin-post-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.admin-post-title:hover { color: var(--color-accent); }
.admin-table-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- 404 ---------- */
.empty-state-page { text-align: center; padding: 100px 0; }
.empty-state-page h1 {
  font-size: 5rem; margin: 0; font-family: var(--font-display); font-weight: 800;
  background: var(--gradient-accent); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--color-border); margin-top: 50px; padding: 28px 0; color: var(--color-text-muted); font-size: 0.84rem; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; height: auto; }
  .hero-feature { height: 340px; }
  .hero-side { flex-direction: column; height: auto; }
  .hero-side-item { height: 160px; flex: none; }
}

@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; gap: 14px; align-items: flex-start; }
  .nav { flex-wrap: wrap; gap: 14px; }
  .page-intro { padding: 40px 0 28px; }
  .orb { display: none; }
}
