:root {
  --bg:     #000;
  --text:   #cfcfcf;
  --bright: #fff;
  --muted:  #7a7a7a;
  --line:   #262626;
  --serif:  Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --mono:   ui-monospace, 'SFMono-Regular', Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font: 1.1rem/1.75 var(--serif); }

a { color: var(--bright); text-decoration: underline; text-decoration-color: #555; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--bright); }
:focus-visible { outline: 2px solid var(--bright); outline-offset: 3px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }
section { padding: 5rem 0; }
h2 { font: 700 1.6rem var(--mono); color: var(--bright); padding-bottom: .6rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
h3 { font: 700 1.25rem var(--serif); color: var(--bright); margin: 2.5rem 0 .8rem; }
p  { margin-bottom: 1.2rem; }
.meta  { font: .85rem var(--mono); color: var(--muted); }
.plain { list-style: none; padding: 0; }

#home { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 1rem; }
.name { font: italic 700 clamp(3rem, 16vw, 11rem)/1 var(--mono); letter-spacing: -.07em; color: var(--bright); }
.role { font: clamp(1rem, 3vw, 1.6rem)/1.6 var(--mono); color: #aaa; margin-top: 1.5rem; min-height: 1.6em; }
.caret { display: inline-block; width: .6ch; height: 1.05em; background: #aaa; margin-left: .3ch; vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.photo { width: 100%; max-width: 340px; aspect-ratio: 1/1; object-fit: cover; border: 1px solid var(--line); background: #0a0a0a; display: grid; place-items: center; font: 700 4rem var(--mono); color: #222; margin-bottom: 2rem; }

.plain li { padding: .9rem 0; border-bottom: 1px dotted var(--line); }
.plain li p { margin: 0; color: var(--muted); font-style: italic; }

.handle { font: 700 clamp(2.2rem, 9vw, 4.5rem)/1 var(--mono); letter-spacing: -.05em; color: var(--bright); margin-bottom: 1.5rem; }
.contacts li { display: flex; justify-content: space-between; gap: 1rem; }
.contacts .k { color: var(--muted); font-family: var(--mono); font-size: .95rem; }

.filters { font: .9rem var(--mono); margin-bottom: 1.5rem; }
.filters button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.filters button:hover, .filters button.on { color: var(--bright); text-decoration: underline; text-underline-offset: 4px; }
.filters button + button::before { content: "/"; margin: 0 .7em; color: var(--line); text-decoration: none; display: inline-block; }

.posts { list-style: none; padding: 0; }
.posts li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px dotted var(--line); }
.posts time { font: .85rem var(--mono); color: var(--muted); padding-top: .35rem; }
.posts .title { font-size: 1.2rem; }
.posts .cat { font: .8rem var(--mono); color: var(--muted); }
.posts .sum { color: var(--muted); font-style: italic; margin-top: .2rem; }
@media (max-width: 600px) { .posts li { grid-template-columns: 1fr; gap: .2rem; } }

.post { padding-top: 3rem; padding-bottom: 5rem; }
.post h1 { font: 700 clamp(1.7rem, 5vw, 2.5rem)/1.2 var(--mono); color: var(--bright); margin: .6rem 0 .8rem; letter-spacing: -.03em; }
.post h3 { font: 700 1.4rem var(--mono); margin-top: 2.2rem; }
.post .cover { width: 100%; display: block; border: 1px solid var(--line); margin: 1.5rem 0 2rem; }
.post pre { background: #050505; border: 1px solid var(--line); padding: 1rem; overflow-x: auto; margin: 1.2rem 0; font: .9rem/1.5 var(--mono); }
.post code { font-family: var(--mono); font-size: .92em; color: var(--bright); }

#depth { position: fixed; left: 1rem; bottom: .8rem; font: .8rem var(--mono); color: var(--muted); pointer-events: none; }
#openEditor { position: fixed; right: 1rem; bottom: .8rem; z-index: 5; background: #000; color: var(--bright); border: 1px solid var(--muted); padding: .3rem .9rem; font: .85rem var(--mono); cursor: pointer; }

dialog { background: #050505; color: var(--text); border: 1px solid var(--line); width: min(780px, 94vw); max-height: 92vh; margin: auto; padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .85); }
.dlg { padding: 1.8rem; font-family: var(--mono); font-size: .95rem; }
.dlg h2 { font-size: 1.2rem; }
.x { float: right; background: none; border: 0; color: var(--muted); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.x:hover { color: var(--bright); }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
form .full { grid-column: 1 / -1; }
label { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); }
input, select, textarea { background: #000; color: var(--text); border: 1px solid var(--line); padding: .5rem .7rem; font: inherit; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
textarea.big { min-height: 300px; }
.btn { background: var(--bright); color: #000; border: 0; padding: .55rem 1.2rem; font: inherit; cursor: pointer; }
.btn.ghost { background: none; color: var(--text); border: 1px solid var(--line); }
.row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.saved { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.saved ul { list-style: none; padding: 0; margin: .6rem 0 .8rem; }
.saved li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; }
.saved li button { background: none; border: 0; color: var(--bright); text-decoration: underline; cursor: pointer; font: inherit; }
@media (max-width: 600px) { form { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .caret { animation: none; } }
