:root{
  --bg:#080807;
  --bg-2:#11100e;
  --paper:#f2eadc;
  --paper-2:#fff8ec;
  --ink:#181611;
  --muted:#6f6658;
  --line:rgba(242,234,220,.18);
  --line-dark:rgba(24,22,17,.16);
  --gold:#c7a66a;
  --gold-dark:#80623b;
  --danger:#8f2f2f;
  --ok:#1f6e48;
  --radius:24px;
}

*{box-sizing:border-box}
html{background:var(--bg)}
body{
  margin:0;
  min-height:100vh;
  color:var(--paper);
  background:
    radial-gradient(circle at top left, rgba(199,166,106,.18), transparent 35rem),
    linear-gradient(135deg, #080807 0%, #13110e 52%, #050505 100%);
  font-family: Georgia, "Times New Roman", serif;
  line-height:1.55;
}

a{color:inherit;text-decoration-thickness:.08em;text-underline-offset:.18em}
img{max-width:100%;height:auto;display:block}

.site-head{
  width:min(1120px, calc(100% - 28px));
  margin:0 auto;
  padding:22px 0 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.brand{
  text-decoration:none;
  display:grid;
  gap:2px;
}
.brand span{
  color:var(--gold);
  font-family:"Courier New", monospace;
  font-size:.72rem;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.brand strong{
  font-size:clamp(1.35rem, 4vw, 2.1rem);
  font-weight:400;
  line-height:1;
}

.top-nav,.admin-nav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.top-nav a,.admin-nav a,.soft-button,.button{
  border:1px solid var(--line);
  border-radius:999px;
  padding:8px 12px;
  text-decoration:none;
  color:var(--paper);
  background:rgba(255,255,255,.03);
  font-family:"Courier New", monospace;
  font-size:.8rem;
}
.top-nav a:hover,.admin-nav a:hover,.soft-button:hover,.button:hover{border-color:var(--gold);color:#fff}

main{
  width:min(1120px, calc(100% - 28px));
  margin:0 auto;
  padding:28px 0 70px;
}

.home-intro{
  padding:clamp(34px, 8vw, 86px) 0 clamp(24px, 5vw, 48px);
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}
.eyebrow,.note-kicker{
  margin:0 0 10px;
  color:var(--gold);
  font-family:"Courier New", monospace;
  font-size:.76rem;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.home-intro h1{
  margin:0;
  font-weight:400;
  font-size:clamp(3.2rem, 14vw, 9rem);
  line-height:.88;
  letter-spacing:-.065em;
}
.home-intro p:not(.eyebrow){
  margin:24px 0 0;
  max-width:760px;
  color:rgba(242,234,220,.78);
  font-size:clamp(1.08rem, 2.5vw, 1.45rem);
}

.home-intro-index{
  padding:clamp(20px, 5vw, 42px) 0 clamp(18px, 4vw, 32px);
}

.home-intro-index p:not(.eyebrow){
  margin-top:10px;
}

.filter-note{
  margin:22px 0 0;
  padding:16px 18px;
  border:1px solid var(--line);
  border-radius:18px;
  color:rgba(242,234,220,.86);
}

.tag-cloud,.tag-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.tag-cloud{margin:22px 0 0}
.tag-cloud a,.tag-row a{
  border:1px solid var(--line);
  border-radius:999px;
  padding:5px 9px;
  color:rgba(242,234,220,.82);
  font-family:"Courier New", monospace;
  font-size:.73rem;
  text-decoration:none;
}
.tag-row.small{
  margin-top:20px;
}
.tag-row.small a{font-size:.68rem;padding:4px 8px}
.tag-cloud a:hover,.tag-row a:hover{border-color:var(--gold);color:#fff}

.notes-grid{
  margin:30px auto 0;
  display:grid;
  grid-template-columns:1fr;
  gap:22px;
  max-width:820px;
}

.note-card{
  min-height:auto;
  padding:clamp(22px, 5vw, 38px);
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:linear-gradient(145deg, rgba(242,234,220,.09), rgba(242,234,220,.035));
  box-shadow:0 24px 70px rgba(0,0,0,.24);
  overflow:hidden;
}

.note-card h2{
  margin:0 0 12px;
  font-size:clamp(2rem, 6vw, 3.1rem);
  line-height:1.02;
  font-weight:400;
  letter-spacing:-.035em;
}
.note-card h2 a{text-decoration:none}
.note-card h2 a:hover{text-decoration:underline}
.note-card p{color:rgba(242,234,220,.74)}

.card-image{
  display:block;
  margin:calc(clamp(22px, 5vw, 38px) * -1) calc(clamp(22px, 5vw, 38px) * -1) 24px;
  max-height:420px;
  overflow:hidden;
  background:#000;
}
.card-image img{width:100%;height:100%;object-fit:cover;filter:saturate(.85) contrast(1.04)}
.card-image.note-gallery,.hero-image.note-gallery{
  position:relative;
  display:block;
  max-height:none;
}
.note-gallery-track{
  display:flex;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  scroll-behavior:smooth;
  scrollbar-width:none;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
  cursor:grab;
}
.note-gallery-track::-webkit-scrollbar{display:none}
.note-gallery-track.is-dragging{cursor:grabbing}
.note-gallery-track > a,
.note-gallery-track > img{
  flex:0 0 100%;
  width:100%;
  min-width:100%;
  scroll-snap-align:start;
  scroll-snap-stop:always;
}
.card-image.note-gallery .note-gallery-track,
.card-image.note-gallery .note-gallery-track img{
  height:420px;
}
.card-image.note-gallery img,
.hero-image.note-gallery img{
  width:100%;
  max-height:none;
  object-fit:cover;
}
.hero-image.note-gallery .note-gallery-track{
  aspect-ratio:3 / 2;
  max-height:72vh;
  background:#000;
}
.hero-image.note-gallery .note-gallery-track img{
  height:100%;
  object-fit:contain;
}
.note-gallery-prev,.note-gallery-next{
  position:absolute;
  top:50%;
  z-index:2;
  transform:translateY(-50%);
  width:40px;
  height:40px;
  border:0;
  border-radius:999px;
  background:rgba(0,0,0,.48);
  color:#fff;
  font:400 1.6rem/1 Georgia, serif;
  cursor:pointer;
}
.note-gallery-prev{left:12px}
.note-gallery-next{right:12px}
.note-gallery-prev:disabled,.note-gallery-next:disabled{
  opacity:0;
  pointer-events:none;
}
.note-gallery-dots{
  position:absolute;
  left:0;
  right:0;
  bottom:12px;
  z-index:2;
  display:flex;
  justify-content:center;
  gap:6px;
}
.note-gallery-dot{
  width:7px;
  height:7px;
  padding:0;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,.45);
  cursor:pointer;
}
.note-gallery-dot.is-on{background:#fff}
.note-gallery-count{
  position:absolute;
  right:12px;
  bottom:10px;
  z-index:2;
  margin:0;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(0,0,0,.48);
  color:#fff;
  font-family:"Courier New", monospace;
  font-size:.72rem;
  letter-spacing:.04em;
}
.empty-card{grid-column:1/-1;min-height:auto}

.pagination{
  margin-top:28px;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:16px;
  color:rgba(242,234,220,.78);
}
.pagination a{
  border:1px solid var(--line);
  border-radius:999px;
  padding:8px 12px;
  text-decoration:none;
}

.single-note{
  max-width:820px;
  margin:0 auto;
}
.back-link{
  display:inline-block;
  margin:0 0 24px;
  color:rgba(242,234,220,.72);
  font-family:"Courier New", monospace;
  font-size:.86rem;
  text-decoration:none;
}
.back-link:hover{color:#fff;text-decoration:underline}

.hero-image{
  margin:0 0 28px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  background:#000;
}
.hero-image img{width:100%}

.note-header{
  padding-bottom:24px;
  border-bottom:1px solid var(--line);
}
.note-header h1{
  margin:0 0 18px;
  font-weight:400;
  font-size:clamp(2.7rem, 9vw, 6.3rem);
  line-height:.92;
  letter-spacing:-.055em;
}

.note-body{
  margin-top:32px;
  color:rgba(242,234,220,.9);
  font-size:clamp(1.08rem, 2vw, 1.22rem);
}
.note-body p{margin:0 0 1.15em}
.note-body h2,.note-body h3{
  margin:1.45em 0 .55em;
  line-height:1.05;
  font-weight:400;
  color:#fff;
}
.note-body h2{font-size:2rem}
.note-body h3{font-size:1.45rem}
.note-body blockquote{
  margin:1.5em 0;
  padding:4px 0 4px 20px;
  border-left:2px solid var(--gold);
  color:rgba(242,234,220,.82);
  font-style:italic;
}
.note-body ul{padding-left:1.2em;margin:0 0 1.2em}
.note-body li{margin:.25em 0}
.note-body a{color:#fff}

.note-body-card{
  margin-top:18px;
  font-size:clamp(1.05rem, 2.4vw, 1.22rem);
}

.note-body-card p{
  color:rgba(242,234,220,.78);
}

.note-body-card p:last-child{
  margin-bottom:0;
}

.site-footer{
  width:min(1120px, calc(100% - 28px));
  margin:0 auto;
  padding:28px 0 46px;
  border-top:1px solid var(--line);
  color:rgba(242,234,220,.55);
  font-family:"Courier New", monospace;
  font-size:.78rem;
}

.admin-body{
  background:var(--paper);
  color:var(--ink);
}
.admin-body .site-head{color:var(--ink)}
.admin-body .brand span{color:var(--gold-dark)}
.admin-body .admin-nav a,.admin-body .top-nav a,.admin-body .soft-button,.admin-body .button{
  color:var(--ink);
  border-color:var(--line-dark);
  background:rgba(0,0,0,.03);
}
.admin-main{max-width:980px;padding-top:24px}
.panel{
  background:var(--paper-2);
  border:1px solid var(--line-dark);
  border-radius:24px;
  padding:clamp(18px, 4vw, 32px);
  box-shadow:0 30px 80px rgba(0,0,0,.12);
}
.login-panel{max-width:460px;margin:40px auto}
.panel h1{margin:0 0 18px;font-size:2.2rem;line-height:1;font-weight:400}
.panel-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}
.notice{
  margin:0 0 18px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line-dark);
  background:#fff;
}
.notice.ok{border-color:rgba(31,110,72,.28);color:var(--ok)}
.notice.error{border-color:rgba(143,47,47,.28);color:var(--danger)}
.muted{color:var(--muted)}

.stacked-form,.editor-form{display:grid;gap:14px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
label{display:grid;gap:6px;font-family:"Courier New", monospace;font-size:.82rem;color:var(--muted)}
input,textarea,select{
  width:100%;
  border:1px solid var(--line-dark);
  border-radius:14px;
  padding:12px 13px;
  font:inherit;
  color:var(--ink);
  background:#fffdf7;
}
textarea{
  min-height:48vh;
  font-family:Georgia,"Times New Roman",serif;
  font-size:1.05rem;
  line-height:1.55;
}
button,.button{
  border:0;
  border-radius:999px;
  padding:11px 16px;
  background:var(--ink);
  color:var(--paper);
  font-family:"Courier New", monospace;
  font-size:.86rem;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
button:hover,.button:hover{filter:brightness(1.12)}
.form-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.current-image{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}
.current-image img{
  width:160px;
  border-radius:14px;
  border:1px solid var(--line-dark);
}
.inline-check{display:flex;grid-auto-flow:column;align-items:center;gap:8px;width:auto}
.inline-check input{width:auto}

.admin-list{display:grid;gap:10px}
.admin-post-row{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  padding:14px;
.current-images{display:grid;gap:12px}
  border:1px solid var(--line-dark);
  border-radius:18px;
  background:#fffdf7;
}
.admin-post-row h2{margin:0 0 6px;font-weight:400;font-size:1.3rem;line-height:1.1}
.admin-post-row p{margin:0;display:flex;gap:8px;flex-wrap:wrap;color:var(--muted);font-family:"Courier New", monospace;font-size:.78rem}
.status-pill{border:1px solid var(--line-dark);border-radius:999px;padding:2px 7px;text-transform:uppercase;font-size:.68rem}
.status-pill.published{border-color:rgba(31,110,72,.34);color:var(--ok)}
.status-pill.draft{border-color:rgba(143,47,47,.22);color:var(--danger)}
.row-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.row-actions a{
  border:1px solid var(--line-dark);
  border-radius:999px;
  padding:7px 10px;
  text-decoration:none;
  font-family:"Courier New", monospace;
  font-size:.78rem;
}
.danger-zone{
  margin-top:28px;
  border-top:1px solid var(--line-dark);
  padding-top:18px;
}
.danger-zone summary{cursor:pointer;color:var(--danger);font-family:"Courier New", monospace}
.delete-form{display:grid;gap:10px;max-width:360px;margin-top:12px}
.delete-form button{background:var(--danger)}

@media (max-width:860px){
  .site-head{align-items:flex-start;flex-direction:column}
  .top-nav,.admin-nav{justify-content:flex-start}
}

@media (max-width:620px){
  .home-intro h1{font-size:clamp(3.1rem, 18vw, 5.8rem)}
  .form-grid{grid-template-columns:1fr}
  .panel-title-row,.admin-post-row{align-items:flex-start;flex-direction:column}
  .row-actions{justify-content:flex-start}
  .note-card{min-height:auto}
}
