/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html,
body {
  height: 100%
}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: #0d0d0d;
  background: #f5f3ee;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none
}

img {
  max-width: 100%;
  display: block
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit
}

/* ---------- tokens ---------- */
:root {
  --bg: #f5f3ee;
  --ink: #0d0d0d;
  --ink-soft: #4a4a4a;
  --paper: #ffffff;
  --blue: #2540ff;
  --yellow: #f7e94b;
  --pink: #ff5a8a;
  --green: #7dd47f;
  --red: #e63946;
  --tape: rgba(247, 233, 75, .55);
}

/* ---------- grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -.02em
}

.logo .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red)
}

.dot.pulse {
  animation: pulse 1.4s infinite
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1
  }

  50% {
    transform: scale(1.4);
    opacity: .6
  }
}

.blink {
  animation: blink 1s steps(2) infinite
}

@keyframes blink {
  50% {
    opacity: 0
  }
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 14px
}

.nav-links a {
  opacity: .7;
  transition: opacity .2s
}

.nav-links a:hover {
  opacity: 1
}

.nav-links .cta {
  opacity: 1;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 80px 32px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .08em;
  opacity: .6;
  margin-bottom: 22px
}

.hero-title {
  font-family: 'Bricolage Grotesque', 'Space Grotesk', sans-serif;
  font-size: clamp(48px, 9vw, 132px);
  line-height: .92;
  letter-spacing: -.04em;
  font-weight: 800;
  max-width: 1100px;
}

.hero-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400
}

.highlight {
  background: var(--yellow);
  padding: 0 .12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transform: rotate(-1deg);
  display: inline-block;
}

.hero-title .chip {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 0 .18em;
  border-radius: .15em;
  transform: rotate(2deg);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
}

.hero-sub {
  max-width: 560px;
  margin-top: 28px;
  font-size: 18px;
  color: var(--ink-soft)
}

.hero-cta {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  transition: transform .15s, background .2s;
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-2px)
}

.btn-primary {
  background: var(--ink);
  color: #fff
}

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink)
}

.btn.small {
  padding: 8px 14px;
  font-size: 13px
}

.btn.full {
  width: 100%;
  justify-content: center
}

/* stickers/tape */
.sticker {
  position: absolute;
  font-family: 'Instrument Serif', serif;
  pointer-events: none;
  user-select: none;
}

.s1 {
  top: 60px;
  right: 120px;
  font-size: 80px;
  color: var(--blue);
  transform: rotate(-15deg)
}

.s2 {
  top: 280px;
  right: 60px;
  font-size: 60px;
  color: var(--pink);
  transform: rotate(20deg)
}

.s3 {
  top: 180px;
  left: 60%;
  font-size: 50px;
  color: var(--green);
  transform: rotate(-8deg)
}

.tape {
  position: absolute;
  width: 120px;
  height: 28px;
  background: var(--tape);
  opacity: .7;
  pointer-events: none
}

.tape-1 {
  top: 40px;
  left: -30px;
  transform: rotate(-25deg)
}

.tape-2 {
  bottom: 20px;
  right: 8%;
  transform: rotate(12deg)
}

/* marquee */
.marquee {
  margin-top: 60px;
  overflow: hidden;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 14px 0;
  background: var(--yellow);
}

.marquee.small {
  margin-top: 0;
  padding: 10px 0;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink)
}

.track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: scroll 26s linear infinite;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.01em
}

@keyframes scroll {
  to {
    transform: translateX(-50%)
  }
}

/* ---------- sections ---------- */
.grid-section {
  padding: 100px 32px;
  max-width: 1200px;
  margin: 0 auto
}

.grid-section.alt {
  background: var(--ink);
  color: #fff;
  max-width: none;
  padding: 100px 32px
}

.grid-section.alt .card {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, .1);
  color: #fff
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .08em;
  opacity: .6;
  padding: 6px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-block
}

.section-head h2,
section h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -.03em;
}

h2 em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px
}

.card {
  background: var(--paper);
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 20px;
  padding: 28px;
  transition: transform .2s
}

.card:hover {
  transform: translateY(-4px)
}

.card i.lucide {
  font-size: 28px;
  color: var(--blue);
  display: block;
  margin-bottom: 16px
}

.card h3 {
  font-size: 20px;
  margin-bottom: 8px;
  letter-spacing: -.01em
}

.card p {
  color: var(--ink-soft);
  font-size: 15px
}

.grid-section.alt .card p {
  color: #aaa
}

/* roles */
.roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px
}

.role {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  padding: 32px;
  transition: border-color .2s
}

.role:hover {
  border-color: var(--yellow)
}

.role-head {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  opacity: .7;
  margin-bottom: 16px
}

.role h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 32px;
  letter-spacing: -.02em;
  margin-bottom: 20px
}

.role ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px
}

.role li {
  color: #ccc;
  font-size: 15px
}

/* login */
.login-section {
  padding: 100px 32px;
  max-width: 1100px;
  margin: 0 auto
}

.login-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--paper);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .1);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .3);
}

.login-side {
  padding: 48px;
  background: var(--yellow);
  position: relative
}

.login-side::after {
  content: "♥";
  position: absolute;
  bottom: 24px;
  right: 32px;
  font-family: 'Instrument Serif', serif;
  font-size: 80px;
  color: var(--red);
  opacity: .4
}

.login-side h2 {
  margin: 20px 0 16px
}

.login-side p {
  color: var(--ink-soft);
  margin-bottom: 24px
}

.hint {
  background: var(--ink);
  color: #fff;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7
}

.hint b {
  color: var(--yellow)
}

.login-form {
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 18px
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  opacity: .7
}

.login-form input {
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  background: #fafafa;
  transition: border-color .15s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff
}

.role-toggle {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: #f0f0ea;
  border-radius: 999px
}

.role-btn {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: .2s;
  opacity: .6
}

.role-btn.active {
  background: var(--ink);
  color: #fff;
  opacity: 1
}

.err {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  font-family: 'JetBrains Mono', monospace
}

/* footer */
.foot {
  padding: 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid rgba(0, 0, 0, .1);
  font-size: 13px;
  color: var(--ink-soft);
}

.mono {
  font-family: 'JetBrains Mono', monospace
}

/* ---------- responsive ---------- */
@media(max-width:820px) {
  .nav {
    padding: 14px 20px
  }

  .nav-links a:not(.cta) {
    display: none
  }

  .hero {
    padding: 48px 20px 40px
  }

  .s1 {
    right: 0;
    top: 20px;
    font-size: 56px
  }

  .s2 {
    right: 10px;
    top: 180px;
    font-size: 42px
  }

  .s3 {
    display: none
  }

  .grid-section,
  .grid-section.alt {
    padding: 60px 20px
  }

  .login-section {
    padding: 60px 20px
  }

  .login-card {
    grid-template-columns: 1fr
  }

  .login-side,
  .login-form {
    padding: 32px
  }

  .marquee .track {
    font-size: 16px;
    gap: 32px
  }
}


/* ---------- admin panel ---------- */
.admin-main {
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.admin-header {
  margin-bottom: 40px;
}

.admin-header h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 8px;
}

.admin-header p {
  opacity: 0.6;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--paper);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, .08);
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-icon {
  width: 56px;
  height: 56px;
  background: var(--blue);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-content h3 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-content p {
  opacity: 0.6;
  font-size: 14px;
}

.admin-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
}

.users-table-wrapper {
  overflow-x: auto;
  margin-bottom: 40px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 16px;
  background: rgba(0, 0, 0, .04);
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  font-weight: 600;
}

.admin-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.admin-table tr:hover {
  background: rgba(0, 0, 0, .02);
}

.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.role-badge.admin {
  background: var(--blue);
  color: white;
}

.role-badge.guest {
  background: var(--green);
  color: white;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.active {
  background: var(--green);
  color: white;
}

.status-badge.inactive {
  background: var(--ink-soft);
  color: white;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, .1);
  background: var(--paper);
  cursor: pointer;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, .05);
}

.btn-icon.delete {
  color: var(--red);
  border-color: rgba(230, 57, 70, .3);
}

.btn-icon.delete:hover {
  background: rgba(230, 57, 70, .1);
}

.admin-form {
  background: var(--paper);
  border-radius: 16px;
  padding: 32px;
  border: 1px solid rgba(0, 0, 0, .08);
  margin-top: 40px;
}

.admin-form h3 {
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  font-size: 14px;
}

.form-group input,
.form-group select {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .2);
  font-family: inherit;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.page-card {
  background: var(--paper);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, .08);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.page-header h3 {
  font-size: 20px;
  font-weight: 700;
}

.page-info {
  margin-bottom: 20px;
}

.page-info p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.page-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
}

.page-status.published {
  background: var(--green);
  color: white;
}

.page-status.draft {
  background: var(--ink-soft);
  color: white;
}

.page-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.empty-state {
  text-align: center;
  padding: 40px;
  opacity: 0.5;
}